[rspec-devel] [ rspec-Bugs-13708 ] Revision 2482 killed custom assertions in spec:ui

noreply at rubyforge.org noreply at rubyforge.org
Sun Sep 16 16:07:14 EDT 2007


Bugs item #13708, was opened at 2007-09-06 10:16
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13708&group_id=797

Category: None
Group: None
Status: Open
Resolution: Accepted
Priority: 3
Submitted By: Marcus Ahnve (mahnve)
Assigned to: Aslak Hellesøy (aslak_hellesoy)
Summary: Revision 2482 killed custom assertions in spec:ui

Initial Comment:
Rev 2482 did something that takes our custom expectations for Selenium using spec:ui out of the call chain - they are no longer called at all. In revision 2481 this works.

I've tried running the Watir examples, which custom expectations we basically copied, and they seem broken too. 

I am trying to locate what in that rev that causes this to happen, but I have so far been unsuccessful.

----------------------------------------------------------------------

>Comment By: Marcus Ahnve (mahnve)
Date: 2007-09-16 22:07

Message:
Ah yes. I was only thinking of stories mapping to
integration tests - but they are currently declared as such. 

Your original proposal is probably good. But I just
remembered that our spec:ui specs are in a separate spec_ui
folder, and not under the spec folder. 

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-09-16 21:12

Message:
Rails matchers everywhere under the spec directory on a Rails project, yes. It even sounds reasonable, but obviously presents us with this problem.

re: Stories. 2 things: 1 - stories are going to live under RAILS_ROOT/stories, not RAILS_ROOT/specs. 2 - they wrap rails IntegrationTest, so they DO include the Rails matchers.

Cheers,
David

----------------------------------------------------------------------

Comment By: Marcus Ahnve (mahnve)
Date: 2007-09-16 21:08

Message:
Did you mean that the other RFE wanted *rails* matchers
available everywhere? 

Your proposed solution sounds like a good compromise. Would
it include stories/ as well?

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-09-13 08:42

Message:
Ah yes - this was a fix to another RFE that wanted the rspec matchers available everywhere under spec.

Need to think about how I want to approach this. Probably undo the other feature so you get rails goodies for free in spec/models, spec/views, spec/controllers, spec/helpers, and spec/lib, but anywhere else you have explicitly say :behaviour_type => :rails.

WDYT?

----------------------------------------------------------------------

Comment By: Marcus Ahnve (mahnve)
Date: 2007-09-06 10:39

Message:
I found the line causing this to happen: 

In 

rspec_on_rails/lib/spec/rails/dsl/behaviour/rails_example.rb,
the line  

Spec::DSL::BehaviourFactory.add_behaviour_class(:default, self)

does something that reoverrides our custom expectations. 

The problem seems to be that the rspec_on_rails expectations
by the call above are defined after our custom definitions.
It therefore only affects our own "have_tag" etc, which have
a expectation with the same name in RSpec On Rails.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13708&group_id=797


More information about the rspec-devel mailing list