On this page:
RubyMine implements extracting
let as follows:
- Introduces the initialization of
rspecdescribe/context block as the first statement.
- Provides an editable template to insert the new name.
- Searches for fragments in the scenarios and replaces them with the
- If a fragment has been found in several scenarios(see example 3), suggests a confirmation dialog:
To perform the refactoring, follow these steps:
- Open for editing an RSpec file in question.
- Make the required selection.
- Do one of the following:
- On the main menu, choose .
- On the context menu of the selection, choose .
- Press Ctrl+Shift+Alt+R.
As a results, a new
let block shows up in the current RSpec block.
| || |
Last modified: 1 August 2018