diff options
author | Rob Gleeson <rob@flowof.info> | 2011-06-05 22:41:48 +0100 |
---|---|---|
committer | Rob Gleeson <rob@flowof.info> | 2011-06-05 22:41:48 +0100 |
commit | 45fcdd7c2edc6d522ace3340a0d64ec8185d7dcb (patch) | |
tree | c82ee94384c43aef08b4f94fc22e86165cebe16e | |
parent | 866445883c1ff0996a43eaf14f8c9c4947bea1d3 (diff) | |
download | method_source-45fcdd7c2edc6d522ace3340a0d64ec8185d7dcb.tar.gz |
Assert no warnings are emitted by method_source.
-rw-r--r-- | test/test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test.rb b/test/test.rb index 334ea82..8fb33b1 100644 --- a/test/test.rb +++ b/test/test.rb @@ -2,11 +2,20 @@ direc = File.dirname(__FILE__) require 'rubygems' require 'bacon' +require 'open4' require "#{direc}/../lib/method_source" require "#{direc}/test_helper" describe MethodSource do + describe "emitted warnings" do + it 'should emit no warnings' do + Open4.popen4 'ruby -I lib -r"method_source" -W -e "exit"' do |pid,stdin,stdout,stderr| + stderr.read.empty?.should == true + end + end + end + describe "source_location (testing 1.8 implementation)" do it 'should return correct source_location for a method' do method(:hello).source_location.first.should =~ /test_helper/ |