summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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