summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mair <jrmair@gmail.com>2011-09-07 04:58:54 +1200
committerJohn Mair <jrmair@gmail.com>2011-09-07 04:58:54 +1200
commit338027387154b6cda2dbf5f948c86582e0abe890 (patch)
treecd0efb4d51f68f39ea3e48c3ee37f03a0fcef5f7
parent3f632e8d1852d6fcaf434b848e85ba2a10741b80 (diff)
downloadmethod_source-338027387154b6cda2dbf5f948c86582e0abe890.tar.gz
fixed tests, now running green on jruby, mri, rbx. version 0.6.5 releasev0.6.5
-rw-r--r--test/test.rb36
-rw-r--r--test/test_helper.rb5
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