-
-
Save tenderlove/ad4a2b19e13c1dcd2a59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
system "gem install psych -v 1.3.4 > /dev/null" | |
system "gem install bundler > /dev/null" | |
class PsychBundler < MiniTest::Unit::TestCase | |
def test_ruby_version | |
assert_equal 35410, RUBY_REVISION, 'you must be on 1.9.3-p194' | |
end | |
def test_psych_versions | |
assert_equal '1.3.2', `ruby -rpsych -e'puts Psych::VERSION'`.chomp | |
assert_equal '1.3.4', `ruby -e'gem "psych"; require "psych"; puts Psych::VERSION'`.chomp | |
end | |
def test_stdlib_with_bundler | |
File.open('Gemfile', 'wb').close # make sure the Gemfile is empty | |
assert_equal '1.3.2', `ruby -rbundler -e'Bundler.setup; require "psych"; p Psych::VERSION' 2>&1`.chomp | |
end | |
def test_gem_with_bundler | |
File.open('Gemfile', 'wb') { |f| | |
f.puts "source 'https://rubygems.org/'" | |
f.puts "gem 'psych', '= 1.3.4'" | |
} | |
system "bundle install > /dev/null" | |
assert_equal '1.3.4', `ruby -rbundler -e'Bundler.setup; require "psych"; puts Psych::VERSION'`.chomp | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment