From 338027387154b6cda2dbf5f948c86582e0abe890 Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 7 Sep 2011 04:58:54 +1200 Subject: fixed tests, now running green on jruby, mri, rbx. version 0.6.5 release --- test/test.rb | 36 +++++++++++++++++++----------------- test/test_helper.rb | 5 +++++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/test/test.rb b/test/test.rb index fd1113f..50d7b82 100644 --- a/test/test.rb +++ b/test/test.rb @@ -8,10 +8,12 @@ require "#{direc}/test_helper" describe MethodSource do - describe "emitted warnings" do - it 'should emit no warnings' do - Open4.popen4 'ruby -I lib -rubygems -r"method_source" -W -e "exit"' do |pid,stdin,stdout,stderr| - stderr.read.empty?.should == true + if !jruby? + describe "emitted warnings" do + it 'should emit no warnings' do + Open4.popen4 'ruby -I lib -rubygems -r"method_source" -W -e "exit"' do |pid,stdin,stdout,stderr| + stderr.read.empty?.should == true + end end end end @@ -81,23 +83,23 @@ describe MethodSource do end # if RUBY_VERSION =~ /1.9/ || is_rbx? - describe "Lambdas and Procs" do - it 'should return source for proc' do - MyProc.source.should == @proc_source - end + describe "Lambdas and Procs" do + it 'should return source for proc' do + MyProc.source.should == @proc_source + end - it 'should return an empty string if there is no comment' do - MyProc.comment.should == '' - end + it 'should return an empty string if there is no comment' do + MyProc.comment.should == '' + end - it 'should return source for lambda' do - MyLambda.source.should == @lambda_source - end + it 'should return source for lambda' do + MyLambda.source.should == @lambda_source + end - it 'should return comment for lambda' do - MyLambda.comment.should == @lambda_comment - end + it 'should return comment for lambda' do + MyLambda.comment.should == @lambda_comment end + end # end describe "Comment tests" do before do diff --git a/test/test_helper.rb b/test/test_helper.rb index fafc1fb..53da4e5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,6 +2,11 @@ def is_rbx? defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /rbx/ end +def jruby? + defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/ +end + + module M def hello; :hello_module; end end -- cgit v1.2.1