gauge-ruby
gauge-ruby copied to clipboard
Refactoring is giving a undefined method error
Expected Behavior Refactoring should not give us an error
Actual Behavior Getting the following error with parameter mismatch in step annotation and implementation.
Cannot perform refactoring: undefined method `children' for nil:NilClass
Steps to replicate
- Create a spec
Specification Heading
=====================
ability to add product
----------------------
tags: shopping basket
* Add "product" to basket1
- Create an implementation with parameter mismatch
step 'Add <product> to basket1' do
puts product
assert_equal(product, 'product')
assert_equal(name, 'Gauge')
end
- refactor from the command line
gauge --refactor "Add \"product\" to basket1" "Add \"product\" to basket2"
getting the above error.
Version
Gauge version: 0.6.1.nightly-2016-07-25
Plugins
-------
csharp (0.9.1.nightly-2016-07-25)
html-report (2.1.1.nightly-2016-07-20)
java (0.5.1.nightly-2016-07-25)
ruby (0.3.1.nightly-2016-07-25)
Unable to reproduce this with latest HEAD. Could you try doing:
$ bundle
$ bundle exec gauge --refactor "Add \"product\" to basket1" "Add \"product\" to basket2"
This issue is still replicable Cannot perform refactoring: undefined method `children' for nil:NilClass
Gauge version: 1.0.1.nightly-2018-07-31
Commit Hash: 4ae7c9a
Plugins
-------
ruby (0.5.2.nightly-2018-07-31)
With bundle exec gauge refactor "Add \"product\" to basket1" "Add \"product\" to basket2"
- the spec file is not changed
- In the implementation file step annotation text changes to
Addinstead of the entire text.