I’ve been messing around with minitest and came across something very
strange. Does anyone have an explanation for what is going on here?
I think it must indicate subtle differences in blocks between 1.8 and
Including a module in a spec does not make constants
available under ruby 1.8 but it does under ruby 1.9.
This script requires the minitest gem to be installed:
% gem install minitest
This passes on ruby 1.9, but not on 1.8.
describe “MiniTest Includes” do
it "should show inclusion works" do B.must_equal A::B end
This passes on both. What’s more, if you uncomment this
spec, the assignment TRANSLATES to the “MiniTest Includes”
spec and that spec will pass!
describe “MiniTest Assigns” do
B = A::B
it “should show assignment works” do
Here is an example showing the assignment case works.
describe “MiniTest Assigns X::Y” do
Y = X::Y
it "should show constant assignment works" do Y.must_equal X::Y end