Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created October 26, 2012 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/ad4a2b19e13c1dcd2a59 to your computer and use it in GitHub Desktop.
Save tenderlove/ad4a2b19e13c1dcd2a59 to your computer and use it in GitHub Desktop.
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