Created
April 27, 2011 20:08
-
-
Save alexch/945067 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/spec" | |
| MiniTest::Unit.autorun | |
| module DescribeBug | |
| class Foo | |
| def ==(other) | |
| other.is_a? Foo | |
| end | |
| end | |
| end | |
| module DescribeBug | |
| describe Foo do | |
| before do | |
| @foo = Foo.new | |
| end | |
| # this describe block gets blown away... | |
| describe '#==' do | |
| it 'is equal to itself' do | |
| assert @foo == @foo | |
| end | |
| end | |
| # ...by this one | |
| describe "#<=>" do | |
| it "compares equally to itself" do | |
| assert (@foo <=> @foo) == 0 | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This bug exists in the version of minitest in ruby's stdlib, but not in recent versions of the gem:
Instead of the weird command line I used, you can get the same effect by putting "gem 'minitest'" above any minitest requires.