Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Foundations Testing MiniTest::Spec

MiniTest::Spec Uninitialized Constant Error

Hello!

In the MiniTest::Spec video, this code (within some other code, mind you) is used to demonstrate must_be_instance_of:

it "must be a FixNum" do
    (2+2).must_be_instance_of FixNum
end

In the video it passes, but when I run it, I keep getting an error that says:

 1) Error:
MyTests#test_0003_must be a FixNum:
NameError: uninitialized constant FixNum
    2-spec.rb:14:in `block (2 levels) in <main>' 

Any idea what might be causing this? Is this a version thing, where maybe my newer version of MiniTest::Spec returns a different kind of error?

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Try Fixnum instead of FixNum. It's all case-sensitive and the video uses lower-case N.

Fantastic catch! Thank you! Working now. :grinning: