While shared_context is not working in rspec-rails 2.13?

58 views
Skip to first unread message

Aydar Omurbekov

unread,
Feb 12, 2015, 3:06:25 AM2/12/15
to rs...@googlegroups.com

I am using rspec-rails (2.13.0) rspec-core (~> 2.13.0) This shared_context is not workinghttp://www.relishapp.com/rspec/rspec-core/v/2-11/docs/example-groups/shared-context


describe "group that includes a shared context using 'include_context'" do
  include_context "shared stuff"

  it "has access to methods defined in shared context" do
    shared_method.should eq("it works")
  end
end


 Failure/Error: include_context "it works"
  NoMethodError:
    undefined method `include_context' for #<RSpec::Core::ExampleGroup::Nested_1:0x0000000aa4b668>

Jon Rowe

unread,
Feb 12, 2015, 3:50:55 AM2/12/15
to rs...@googlegroups.com
No idea why that’s not working with your short snippet of code, but you’re running a very out of date version of RSpec, you should upgrade to 2.99, which should be entirely compatible with your existing test suite, fix any deprecations or warnings (transpec can help with this) and then upgrade to 3.2, we have comprehensive documentation on how to do this at http://rspec.info/upgrading-from-rspec-2/

Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/9f0316b0-ad4a-4eea-a0d0-d9fdb8d97be4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages