'my script should have no errors or warnings' FAILED expected not: =~ /warning/n, got: "(Rubyインストールディレクトリ)/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:138: warning: d:/my_home/.gem/ruby/1.8:(Rubyインストールディレクトリ)/lib/ruby/gems/1.8/specifications: Invalid argument\nHelloWorld\n" ./spec/hello_spec.rb:15: ./spec/hello_spec.rb:13:in `chdir' ./spec/hello_spec.rb:13:
hello_spec.rbのソース require File.join(File.dirname(__FILE__), '/spec_helper.rb') describe "my script" do before do @bin_path = File.join(File.dirname(__FILE__), "/../hello.rb") end
it "should have no errors or warnings" do pending "Hangs on JRuby" if PLATFORM =~ /java/
Dir.chdir(File.join(File.dirname(__FILE__), "/../")) do output = `ruby -w #{@bin_path} --help 2>&1` output.should_not =~ /warning/n output.should_not =~ /Error/n end end end