jimweirich / rspec-given

Given/When/Then keywords for RSpec Specifications
https://github.com/jimweirich/rspec-given
MIT License
653 stars 61 forks source link

Check that Rspec/Given works with RSpec 3.xx #35

Closed jimweirich closed 10 years ago

sankage commented 10 years ago

I just tried this with the rspec-rails 3.0.0.beta and got this as a result:

Resolving dependencies...
Bundler could not find compatible versions for gem "rspec-mocks":
  In Gemfile:
    rspec-given (~> 3.4.0) ruby depends on
      rspec-mocks (~> 2.12.0) ruby

    rspec-rails (~> 3.0.0.beta) ruby depends on
      rspec-mocks (3.0.0.beta1)
jimweirich commented 10 years ago

I don't make that dependency in rspec-given. This is the dependency line I'm using:

    s.add_dependency("rspec", ">= 2.12")

I suspect that you have that dependency locked down in the Gemfile.lock file of your project.

sankage commented 10 years ago

I realized that and thats why I am confused. rspec-rails is already in the Gemfile.lock, then I add rspec-given and it now fails dependency resolution.

Ah, now I see. rspec-rails doesnt specifically load rspec. It just loads rspec's dependencies:

    rspec-rails (3.0.0.beta1)
      actionpack (>= 3.0)
      activemodel (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-collection_matchers
      rspec-core (= 3.0.0.beta1)
      rspec-expectations (= 3.0.0.beta1)
      rspec-mocks (= 3.0.0.beta1)

So for now to get it to work, if rspec-rails is used, you should also add the rspec gem.