Discussion:
[Cucumber] [cucumber-cpp] undefined method 'registry' when running example test
(too old to reply)
'Regis Hoffman' via Cukes
2018-02-13 16:47:19 UTC
Permalink
I am trying to run the example tests in the cucumber-cpp repository and
encounter an error.

The system is Ubuntu 16.04 LTS. The installed cucumber versions are:

cucumber (3.1.0)
cucumber-core (3.1.0)
cucumber-expressions (5.0.13)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)

I cd to cucumber-cpp/build/examples and run BoostCalculatorSteps

I cd to cucumber-cpp/examples/Calc and run cucumber .
[Note: it seems from other posts that one should be in the directory
containing the features directory]

I get an error about “undefined method ‘registry’ “ as shown below.

Any ideas on the cause and/or solution?

Feature: Addition
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers

Scenario Outline: Add two numbers #
./features/addition.feature:7
Given I have entered <input_1> into the calculator #
./features/addition.feature:8
And I have entered <input_2> into the calculator #
./features/addition.feature:9
When I press <button> #
./features/addition.feature:10
Then the result should be <output> on the screen #
./features/addition.feature:11

Examples:
| input_1 | input_2 | button | output |
| 20 | 30 | add | 50 |
undefined method `registry' for
#<Cucumber::Wire::StepDefinition:0x00000000a4ebb0> (NoMethodError)
./features/addition.feature:15:in `Given I have entered 20 into the
calculator'
./features/addition.feature:8:in `Given I have entered <input_1> into
the calculator'
| 2 | 5 | add | 7 |
undefined method `registry' for
#<Cucumber::Wire::StepDefinition:0x000000009cca20> (NoMethodError)
./features/addition.feature:16:in `Given I have entered 2 into the
calculator'
./features/addition.feature:8:in `Given I have entered <input_1> into
the calculator'
| 0 | 40 | add | 40 |
undefined method `registry' for
#<Cucumber::Wire::StepDefinition:0x000000009afc90> (NoMethodError)
./features/addition.feature:17:in `Given I have entered 0 into the
calculator'
./features/addition.feature:8:in `Given I have entered <input_1> into
the calculator'

Feature: Division
In order to avoid silly mistakes
Cashiers must be able to calculate a fraction

Scenario: Regular numbers #
./features/division.feature:6
undefined method `group' for #<Cucumber::StepArgument:0x000000008fb6f0
@offset=15, @val="3"> (NoMethodError)
/var/lib/gems/2.3.0/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:73:in
`block in replace_arguments'
/var/lib/gems/2.3.0/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:72:in
`each'
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
d***@polysync.io
2018-02-23 01:07:40 UTC
Permalink
I had this same issue. Rolling back Cucumber to version 2.4.0 fixed it for
me.
Post by 'Regis Hoffman' via Cukes
I am trying to run the example tests in the cucumber-cpp repository and
encounter an error.
cucumber (3.1.0)
cucumber-core (3.1.0)
cucumber-expressions (5.0.13)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
I cd to cucumber-cpp/build/examples and run BoostCalculatorSteps
I cd to cucumber-cpp/examples/Calc and run cucumber .
[Note: it seems from other posts that one should be in the directory
containing the features directory]
I get an error about “undefined method ‘registry’ “ as shown below.
Any ideas on the cause and/or solution?
Feature: Addition
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers
Scenario Outline: Add two numbers #
./features/addition.feature:7
Given I have entered <input_1> into the calculator #
./features/addition.feature:8
And I have entered <input_2> into the calculator #
./features/addition.feature:9
When I press <button> #
./features/addition.feature:10
Then the result should be <output> on the screen #
./features/addition.feature:11
| input_1 | input_2 | button | output |
| 20 | 30 | add | 50 |
undefined method `registry' for
#<Cucumber::Wire::StepDefinition:0x00000000a4ebb0> (NoMethodError)
./features/addition.feature:15:in `Given I have entered 20 into the
calculator'
./features/addition.feature:8:in `Given I have entered <input_1>
into the calculator'
| 2 | 5 | add | 7 |
undefined method `registry' for
#<Cucumber::Wire::StepDefinition:0x000000009cca20> (NoMethodError)
./features/addition.feature:16:in `Given I have entered 2 into the
calculator'
./features/addition.feature:8:in `Given I have entered <input_1>
into the calculator'
| 0 | 40 | add | 40 |
undefined method `registry' for
#<Cucumber::Wire::StepDefinition:0x000000009afc90> (NoMethodError)
./features/addition.feature:17:in `Given I have entered 0 into the
calculator'
./features/addition.feature:8:in `Given I have entered <input_1>
into the calculator'
Feature: Division
In order to avoid silly mistakes
Cashiers must be able to calculate a fraction
Scenario: Regular numbers #
./features/division.feature:6
undefined method `group' for #<Cucumber::StepArgument:0x000000008fb6f0
@offset=15, @val="3"> (NoMethodError)
/var/lib/gems/2.3.0/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:73:in
`block in replace_arguments'
/var/lib/gems/2.3.0/gems/cucumber-3.1.0/lib/cucumber/step_match.rb:72:in
`each'
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...