nil:NilClass (NoMethodError) occurs If the spec file name is named as "bowling_rspec.rb" using JRuby #190

Closed
bulkan opened this Issue Oct 13, 2010 · 4 comments

2 participants

@bulkan

Steps to reproduce

  • create a new file named bowling_rspec.rb and copy/paste the example rspec

    require 'bowling'

    describe Bowling, "#score" do
    it "returns 0 for all gutter game" do
    bowling = Bowling.new
    20.times { bowling.hit(0) }
    bowling.score.should == 0
    end
    end

  • run it via rspec bowling_rspec.rb

D:\dev\bowling>rspec bownling_rspec.rb
F

Failures:
1) Bowling#score returns 0 for all gutter game
c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_formatter.rb:138:in find_failed_line': undefined methoddowncase' for ni
l:NilClass (NoMethodError)
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_formatter.rb:136:in detect'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_formatter.rb:136:in
find_failed_line'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_formatter.rb:122:in read_failed_line'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_text_formatter.rb:27:in
dump_failures'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in each'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in
each_with_index'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in dump_failures'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/reporter.rb:74:in
notify'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/reporter.rb:73:in each'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/reporter.rb:73:in
notify'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/reporter.rb:22:in conclude'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/reporter.rb:13:in
report'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/command_line.rb:23:in run'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:55:in
run_in_process'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:46:in run'
from c:/jruby-1.5.3/lib/ruby/gems/1.8/gems/rspec-core-2.0.0/lib/rspec/core/runner.rb:10:in
autorun'
from :1

@dchelimsky
RSpec member

Please post the full backtrace.

@bulkan

Sorry I forgot. I have posted the stacktrace now

@dchelimsky
RSpec member

Thanks - that's a big help.

@dchelimsky
RSpec member

Determine example and group location without restricting to a file
pattern.

@timcharper timcharper pushed a commit to timcharper/rspec-core that referenced this issue Aug 19, 2011
@dchelimsky dchelimsky Determine example and group location without restricting to a file
pattern.

- Closes #190.
9c6b6f7
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment