summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Mair <jrmair@gmail.com>2011-06-05 22:42:51 -0700
committerJohn Mair <jrmair@gmail.com>2011-06-05 22:42:51 -0700
commit828a56c9feab63bb05da0c4c265d30588e7bec82 (patch)
treec82ee94384c43aef08b4f94fc22e86165cebe16e /test
parent50c2f8492b04a4ec9d559b212b418649fce61105 (diff)
parent45fcdd7c2edc6d522ace3340a0d64ec8185d7dcb (diff)
downloadmethod_source-828a56c9feab63bb05da0c4c265d30588e7bec82.tar.gz
Merge pull request #5 from robgleeson/master
Assert no warnings are emitted by method_source.
Diffstat (limited to 'test')
-rw-r--r--test/test.rb9
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/