Possibly a bug in RSpec handling

View: New views
2 Messages — Rating Filter:   Alert me  

Possibly a bug in RSpec handling

by Dentharg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have this auction_parser_spec.rb

describe AuctionParser do
    before(:each) do
        @ap = AuctionParser.new
    end

    it "should initialize empty $auction when created" do
        @ap.auction.should_not == nil
    end

    after do
        @ap = nil
    end
end

where the class is

class AuctionParser
    attr_reader :auction

    def initialize
    end
end

running RSpec from cmdline gives appropriate fail for the spec. Netbeans also... well, at least partially.

in right pane of Ruby Test Results is
1)
'AuctionParser should initialize empty $auction when created' FAILED
expected not: == nil,
         got:    nil
D:\Devel\Personal\acrawl\spec\parser\auction_parser_spec.rb:11

Finished in 0.032 seconds

1 example, 1 failure


in left
"No tests exectued"
  + AuctionParser PASSED

Re: Possibly a bug in RSpec handling

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Seems like a bug indeed, I was able to reproduce this with your example.
Could you please file an issue for this (against the ruby/testing
component)? I could file one myself, but then you wouldn't get notified
when the issue gets fixed.

Thanks for catching this,

Erno

Dentharg wrote:

> I have this auction_parser_spec.rb
>
> describe AuctionParser do
>     before(:each) do
>         @ap = AuctionParser.new
>     end
>
>     it "should initialize empty $auction when created" do
>         @ap.auction.should_not == nil
>     end
>
>     after do
>         @ap = nil
>     end
> end
>
> where the class is
>
> class AuctionParser
>     attr_reader :auction
>
>     def initialize
>     end
> end
>
> running RSpec from cmdline gives appropriate fail for the spec. Netbeans
> also... well, at least partially.
>
> in right pane of Ruby Test Results is
> 1)
> 'AuctionParser should initialize empty $auction when created' FAILED
> expected not: == nil,
>          got:    nil
> D:\Devel\Personal\acrawl\spec\parser\auction_parser_spec.rb:11
>
> Finished in 0.032 seconds
>
> 1 example, 1 failure
>
>
> in left
> "No tests exectued"
>   + AuctionParser PASSED
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...