The following code doesn't compile in ruby 2.1 on OS X. The error message is quite strange:
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:10:in `require':
/Users/jayunit100/Development/leitmotif/test/test_leitmotif.rb:21:
syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
That is, it is requesting that i remove the final "end" statement from the class, and when i do so, it indeed compiles ! So my first question is , how or why it is that the rake_test_loader wants a class declaration without a closing end block.
require 'helper'
require 'minitest/autorun'
class TestLeitmotif < MiniTest::Test
### A simple test
context "Leitmotif core tests" do
setup do
@lm = Leitmotif.new
end
should "run should return 1 if arguments are invalid"
@lm=Leitmotif.new
print("\nASDF\n")
print(@lz.inspect);
print(@lm.inspect)
print("\nASDF\n")
x=@lm.run("","")
#assert_equal 1, x
end
end
end
My second problem here is that the variable
@lm = Leimotif.new
Which is declared in the setup block, seems to be inaccessible in the should method.
My suspicion here is that somehow the syntax of the should framework is not parsed correctly in the current version of ruby, but am quite new to ruby so any insight would be appreciated.
Thanks!