diff options
author | John Mair <jrmair@gmail.com> | 2011-06-05 22:42:51 -0700 |
---|---|---|
committer | John Mair <jrmair@gmail.com> | 2011-06-05 22:42:51 -0700 |
commit | 828a56c9feab63bb05da0c4c265d30588e7bec82 (patch) | |
tree | c82ee94384c43aef08b4f94fc22e86165cebe16e | |
parent | 50c2f8492b04a4ec9d559b212b418649fce61105 (diff) | |
parent | 45fcdd7c2edc6d522ace3340a0d64ec8185d7dcb (diff) | |
download | method_source-828a56c9feab63bb05da0c4c265d30588e7bec82.tar.gz |
Merge pull request #5 from robgleeson/master
Assert no warnings are emitted by method_source.
-rw-r--r-- | Rakefile | 3 | ||||
-rw-r--r-- | test/test.rb | 9 |
2 files changed, 12 insertions, 0 deletions
@@ -20,7 +20,10 @@ def apply_spec_defaults(s) s.description = s.summary s.require_path = 'lib' s.add_dependency("ruby_parser",">=2.0.5") + s.add_development_dependency("bacon",">=1.1.0") + s.add_development_dependency("open4", "~> 1.0.1") + s.homepage = "http://banisterfiend.wordpress.com" s.has_rdoc = 'yard' s.files = Dir["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "lib/**/*.rb", 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/ |