collectiveidea/json_spec — Issue #12: undefined method `exclude_keys'
Author: petRUShka
Created: 2011-10-09 12:27:55+00:00
State: open

I'm using json_spec with cucumber. I added

require "json_spec/cucumber"

to `env.rb`. And when I run cucumber features I get such error:

undefined method `exclude_keys' for # (NoMethodError)
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rspec-expectations-2.5.0/lib/rspec/matchers/method_missing.rb:9:in `method_missing'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rspec-expectations-2.5.0/lib/rspec/matchers/matcher.rb:114:in `method_missing'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/json_spec-0.7.0/lib/json_spec/matchers.rb:40:in `scrub'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/json_spec-0.7.0/lib/json_spec/matchers.rb:11:in `block (2 levels) in '
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rspec-expectations-2.5.0/lib/rspec/matchers/matcher.rb:39:in `instance_exec'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rspec-expectations-2.5.0/lib/rspec/matchers/matcher.rb:39:in `matches?'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rspec-expectations-2.5.0/lib/rspec/expectations/handler.rb:11:in `handle_matcher'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/rspec-expectations-2.5.0/lib/rspec/expectations/extensions/kernel.rb:27:in `should'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/json_spec-0.7.0/lib/json_spec/cucumber.rb:17:in `block in '
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/step_match.rb:26:in `invoke'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/step_invocation.rb:63:in `invoke'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/step_invocation.rb:42:in `accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/step_collection.rb:14:in `each'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/step_collection.rb:14:in `accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:53:in `block (2 levels) in accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:79:in `block (2 levels) in with_hooks'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:95:in `before_and_after'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:78:in `block in with_hooks'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:115:in `call'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:115:in `block (3 levels) in around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:13:in `block in around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:95:in `call'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:95:in `execute_around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/language_support/language_methods.rb:12:in `around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:114:in `block (2 levels) in around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:112:in `call'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime/support_code.rb:112:in `around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:90:in `around'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:77:in `with_hooks'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:51:in `block in accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:106:in `with_visitor'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/scenario.rb:45:in `accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:40:in `block in accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:39:in `each'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:39:in `accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:29:in `block in accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:17:in `each'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:17:in `each'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:28:in `accept'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:45:in `run!'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:43:in `execute!'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:20:in `execute'
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-0.10.2/bin/cucumber:14:in `'
/home/user/.rvm/gems/ruby-1.9.2-p290/bin/cucumber:19:in `load'
/home/user/.rvm/gems/ruby-1.9.2-p290/bin/cucumber:19:in `

'
features/manage_api.feature:15:in `Then the JSON response at "user" should be:'

I'm iusing Ruby 1.9.2 and Rails 3. Same error on Ruby 1.8.7