Skip to content

Commit

Permalink
Auto merge of rubygems#4990 - bundler:seg-realworld-flex, r=segiddins
Browse files Browse the repository at this point in the history
Dynamically fetch expected rails version

This way, we don't have to update this expectation every time a new rails version comes out
  • Loading branch information
homu committed Sep 15, 2016
2 parents b3cb951 + 31ceb89 commit 0c7a57c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/realworld/edgecases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@
gem 'capybara', '~> 2.2.0'
gem 'rack-cache', '1.2.0' # last version that works on Ruby 1.9
G
bundle :lock
expect(lockfile).to include("rails (3.2.22.4)")
bundle! :lock
rails_version = ruby(<<-R)
require 'rubygems'
require 'bundler'
fetcher = Bundler::Fetcher.new(Bundler::Source::Rubygems::Remote.new(URI('https://rubygems.org')))
index = fetcher.specs(%w(rails), nil)
rails = index.search(Gem::Dependency.new("rails", "~> 3.0")).last
puts rails.version
R
expect(lockfile).to include("rails (#{rails_version})")
expect(lockfile).to include("capybara (2.2.1)")
end

Expand Down

0 comments on commit 0c7a57c

Please sign in to comment.