From: Josh Cheek Date: 2011-09-19T20:58:44+09:00 Subject: Re: How-to run a 'minitest' test? --20cf307c9ac072306704ad4a10fd Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 19, 2011 at 5:44 AM, Lb Tr wrote: > Hi, > > I am trying run the attached test which I found on the 'minitest' > website: http://bfts.rubyforge.org/minitest/. > > However, when I run the meme_test.rb from the command-line I get the > following error message: > > C:/Documents and Settings/lblake/Desktop/meme_test.rb:4:in ` (required)>': uninitialized constant Object::Meme (NameError) > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in > `load' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in > `block in load_spec_files' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in > `map' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in > `load_spec_files' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in > `run' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in > `run_in_process' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in > `run' > from > > C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in > `block in autorun' > > > I've installed the minitest and rspec gems, I've also tried running > rspec meme_test.rb from the command-line with the same result. Is there > something wrong with the code or how I am trying to execute the test? > > Lb > > Attachments: > http://www.ruby-forum.com/attachment/6607/meme.rb > http://www.ruby-forum.com/attachment/6608/meme_test.rb > > > -- > Posted via http://www.ruby-forum.com/. > > Honestly, it just depends what you're trying to do. If you just want to run it and see them pass, throw them all in the same file and run it. If you want a really simple script with just the two files, do what Justin said and use require_relative to have the test suite pull the other one in. If you want to create real app or library, put your stuff where it belongs, set up the load path, and require like normal. --20cf307c9ac072306704ad4a10fd--