test/runner_test.rb in ripl-0.3.6 vs test/runner_test.rb in ripl-0.4.0
- old
+ new
@@ -292,8 +292,18 @@
mod.send(:define_method, meth) { "pong_#{meth}" }
Runner.extend mod
Runner.send(meth).should == "pong_#{meth}"
end
end
+
+ it "Runner::MESSAGES only calls #[]" do
+ str = File.read(File.dirname(__FILE__)+'/../lib/ripl/runner.rb')
+ str.scan(/MESSAGES\S+/).all? {|e| e[/MESSAGES\[/] }.should == true
+ end
+
+ it "Runner::OPTIONS only calls #[] and values" do
+ str = File.read(File.dirname(__FILE__)+'/../lib/ripl/runner.rb')
+ str.scan(/OPTIONS[^_\] ]\S+/).all? {|e| e[/OPTIONS(\[|\.values)/] }.should == true
+ end
after_all { Runner.extend Runner::API }
end
end