[rspec-users] issues with the trunk of rspec-rails
dchelimsky at gmail.com
Wed Feb 11 23:40:15 EST 2009
On Wed, Feb 11, 2009 at 2:52 PM, nathan at pivotalsf.com <nwilmes at gmail.com> wrote:
> On Feb 10, 8:49 pm, David Chelimsky <dchelim... at gmail.com> wrote:
>> On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes <nat... at pivotallabs.com> wrote:
>> > (3) with_tag is completely broken, as it tries to use the outer class as the
>> > subject of 'with_tag', rather than the have_tag matcher that it lives
>> > inside.
>> Was it working before and the upgrade broke existing specs? Or is this
>> a general observation?
> Yes, the upgrade broke existing specs.. it used to work fine as of
> rspec 1.1.4.
> The breakage appears to have something to do with the 'subject'
Taking a closer look at this - before we introduced the implicit
subject, nested with_tag and without_tags were passing in the
ExampleGroup. The matcher was (and still is) ignoring that argument,
and using the HTML it got from the have_tag call.
There are also a number of specs in rspec's own suite that show that
this works correctly. These pass against rails 2.0.5, 2.1.2, 2.2.2,
2.3.0 and edge (as of earlier today).
Take a look at http://github.com/dchelimsky/rspec-rails/blob/333810bf6f062599bd39007a3fe32ba227a4b32a/spec/spec/rails/matchers/assert_select_spec.rb
and scroll down to 289, for example.
Can you show me an example of what's failing for you? Spec and subject
code, and the failure message?
More information about the rspec-users