Use RSpec::Core::Version instead of RSpec::Version #1332

Merged
merged 1 commit into from Jun 14, 2014

Conversation

Projects
None yet
2 participants
Contributor

hanachin commented Jun 14, 2014

because capybara/rspec requires rspec-core, but not rspec.

@hanachin hanachin Use RSpec::Core::Version instead of RSpec::Version
because capybara/rspec requires rspec-core, but not rspec.
3a9016f
Contributor

hanachin commented Jun 14, 2014

It cause error when you use capybara/rspec without rspec.

The sample project is here, add rspec-rails and capybara to new rails project.
rspec-rails automatically loads capybara/rspec and causes error.

https://github.com/hanachin/rspec-rails-example

/opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core.rb:164:in `block in const_missing': uninitialized constant RSpec::Version (NameError)
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core.rb:164:in `fetch'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core.rb:164:in `const_missing'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/capybara-6d3d8d915a6a/lib/capybara/rspec/features.rb:1:in `<top (required)>'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/capybara-6d3d8d915a6a/lib/capybara/rspec.rb:5:in `<top (required)>'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.1/lib/rspec/rails/vendor/capybara.rb:2:in `<top (required)>'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.1/lib/rspec/rails.rb:9:in `<top (required)>'
    from /Users/sei/my/rspec-rails-example/spec/rails_helper.rb:5:in `<top (required)>'
    from /Users/sei/my/rspec-rails-example/spec/features/sample_spec.rb:1:in `require'
    from /Users/sei/my/rspec-rails-example/spec/features/sample_spec.rb:1:in `<top (required)>'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `load'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `block in load_spec_files'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `each'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `load_spec_files'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:97:in `setup'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:85:in `run'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:70:in `run'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:38:in `invoke'
    from /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/exe/rspec:4:in `<main>'
/opt/boxen/rbenv/versions/2.1.2/bin/ruby -I/opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib:/opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-support-3.0.0/lib -S /opt/boxen/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/exe/rspec ./spec/features/sample_spec.rb failed

@twalpole twalpole added a commit that referenced this pull request Jun 14, 2014

@twalpole twalpole Merge pull request #1332 from hanachin/use-rspec-core-version
Use RSpec::Core::Version instead of RSpec::Version
6ba0c70

@twalpole twalpole merged commit 6ba0c70 into teamcapybara:master Jun 14, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Collaborator

twalpole commented Jun 14, 2014

Thanks

hanachin deleted the hanachin:use-rspec-core-version branch Jun 15, 2014

Contributor

hanachin commented Jun 15, 2014

welcome 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment