Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

restored the ability to use method missing matchers like be_blank or be_t #460

Merged
merged 1 commit into from Dec 4, 2011

Conversation

Projects
None yet
2 participants
Contributor

deadlyicon commented Nov 8, 2011

restored the ability to use method missing matchers like be_blank or be_true in before blocks for routing example groups

be_blank invoked the method missing within lib/rspec/rails/example/routing_example_group.rb which would try and check routes.url_helpers.respond_to? but routes is nil in before blocks that run before the before block in that same file.

NoMethodError: undefined method `url_helpers' for nil:NilClass

@deadlyicon deadlyicon restored the ability to use method missing matchers like be_blank or …
…be_true in before blocks for routing example groups
c1c2f60
Owner

dchelimsky commented Nov 12, 2011

This needs specs. If you're comfortable with the rspec-rails dev environment, please add them. If not, I'll do it, but I'd rather they come from you than me :)

@dchelimsky dchelimsky added a commit that referenced this pull request Dec 4, 2011

@dchelimsky dchelimsky Merge pull request #460 from deadlyicon/patch-1
define @routes on demand instead of in before hook (ensures they are present for before hooks that might run earlier)
37da9b0

@dchelimsky dchelimsky merged commit 37da9b0 into rspec:master Dec 4, 2011

@dchelimsky dchelimsky added a commit that referenced this pull request Dec 4, 2011

@dchelimsky dchelimsky Revert "restored the ability to use method missing matchers like be_b…
…lank or be_true in before blocks for routing example groups"

This reverts commit c1c2f60.

Unfortunately, there is code outside rspec's control that refers
directly to the instance variable, so this change ends up breaking more
than it fixes.

- Reopens #460.
eb08f7d
Owner

dchelimsky commented Dec 4, 2011

Looks like github doesn't support reopening pull requests. I reverted it because it broke behavior that depended on the instance variable being set (i.e. rails code that accesses the ivar directly, not through a method call).

Contributor

deadlyicon commented Dec 4, 2011

I dont quite understand the bug you're describing. Is there a test for it? Hopefully a solution can be found that fixes both bugs. =)

Owner

dchelimsky commented Dec 4, 2011

Take a look at http://travis-ci.org/#!/rspec/rspec-rails/builds/370861. This was the build after merging this pull. There is no direct spec for it, but as you can see the routing specs run by cucumber as a smoke test all fail as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment