1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/initializer/check_ruby_version_test.rb

34 lines
700 B
Ruby
Raw Normal View History

require "isolation/abstract_unit"
module InitializerTests
2009-12-28 14:40:23 -05:00
class CheckRubyVersionTest < Test::Unit::TestCase
include ActiveSupport::Testing::Isolation
def setup
build_app
boot_rails
end
2009-12-28 14:40:23 -05:00
test "rails initializes with ruby 1.8.7 or later" do
if RUBY_VERSION < '1.8.7'
assert_rails_does_not_boot
else
assert_rails_boots
end
end
2009-12-28 14:40:23 -05:00
def assert_rails_boots
assert_nothing_raised "It appears that rails does not boot" do
2009-11-30 18:58:38 -05:00
require "rails"
end
end
2009-12-28 14:40:23 -05:00
def assert_rails_does_not_boot
$stderr = File.open("/dev/null", "w")
assert_raises(SystemExit) do
2009-11-30 18:58:38 -05:00
require "rails"
end
end
end
end