Renaming RailsExample to RailsExampleGroup

Fyi, I made the following renames:

  • RailsExample -> RailsExampleGroup
  • FunctionalExample -> FunctionalExampleGroup
  • ControllerExample -> ControllerExampleGroup
  • ViewExample -> ViewExampleGroup
  • HelperExample -> HelperExampleGroup
  • ModelExample -> ModelExampleGroup

This was done to keep the naming consistent with ExampleGroup.

Just seven upped the latest rspec update, and suddenly all my
be_matchers don’t work anymore (they worked just before I updated):

User.find_by_email(email).should_not be_confirmed
User.find_by_email(email).confirmation_code.should_not be_nil

FAILURES:
1) confirmation (Receives confirmation link) FAILED
NoMethodError: undefined method `be_nil’ for
#ActionController::Integration::Session:0x31bb7d4

 3) confirmation (Clicks correct confirmation link) FAILED
 NoMethodError: undefined method `be_confirmed' for

#ActionController::Integration::Session:0x3196ce0

Anyone else getting that?

Daniel

On 11/26/07, Daniel T. [email protected] wrote:

Just seven upped the latest rspec update, and suddenly all my
be_matchers don’t work anymore (they worked just before I updated):

Anyone else getting that?

All of my controller specs are passing, but my stories are failing
with the same error.

This works:
response.success?.should == true

This doesn’t:
response.should be_success


Josh K.
phone: 509-979-1593
email: [email protected]
web: http://joshknowles.com

On Nov 26, 2007 11:57 AM, Josh K. [email protected] wrote:

This works:
response.success?.should == true

This doesn’t:
response.should be_success

Actually I’m surprised these were ever working as RailsStory doesn’t
include Spec::Matchers - just Spec::Rails::Matchers. The matchers must
have been making their way in through the back door.

I won’t have time to look at this until tonight, but feel free to
submit a patch in the mean time if you can figure it out.

Cheers,
David

First time I have a look inside the RSpec codebase (let alone the
Story Runner), and not much luck this time. But, counter-intuitively
enough, I think it’s probably nothing to do with RailsStory itself
since that didn’t change in the last update. Trying to add an include
Spec::Matchers in there also didn’t help.

Couldn’t quite figure it out though. Too much to absorb in a single
sitting.

I’d love to know what it was when someone figures it out though.

Daniel

On Nov 26, 2007 1:09 PM, Daniel T. [email protected] wrote:

First time I have a look inside the RSpec codebase (let alone the
Story Runner), and not much luck this time. But, counter-intuitively
enough, I think it’s probably nothing to do with RailsStory itself
since that didn’t change in the last update. Trying to add an include
Spec::Matchers in there also didn’t help.

Couldn’t quite figure it out though. Too much to absorb in a single
sitting.

I’d love to know what it was when someone figures it out though.

I can tell you that what’s been changing is the relationship between
rspec and T/U. We’re moving towards an interop model where rspec can
run “pure” or can co-exist w/ Test::Unit when it is loaded. This will
make it easier for us to also support miniunit when it ships w/ Ruby
1.9.

My guess is that IntegrationTest, which I believe derives from
Test::Unit::TestCase, was implicitly inheriting all of the matchers,
but is not any longer due to something that changed under the hood.
Since there were no stories or examples of rails stories, nothing
broke. We’ll have to add some of those :slight_smile:

Again - I’ll look at this tonight and get it working.

Cheers,
David

These are the files that got modified in between. Revision 2994 has
the matchers working.

Reversing to 2994 highlighted these files:

danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins/
rspec$ svn up -r 2995
D stories/example_groups/nested_groups
D stories/resources/spec/nested_group_spec.rb
U stories/resources/steps/running_rspec.rb
Updated to revision 2995.
danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins/
rspec$ cd …
danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins
$ cd rspec_on_rails/
danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins/
rspec_on_rails$ svn up -r 2995
At revision 2995.
danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins/
rspec_on_rails$ svn up -r 2994
U lib/spec/rails/version.rb
A lib/spec/rails/example/behaviour/functional_example.rb
A lib/spec/rails/example/behaviour/controller_example.rb
U lib/spec/rails/example/behaviour/rails_example_group.rb
A lib/spec/rails/example/behaviour/rails_example.rb
A lib/spec/rails/example/behaviour/view_example.rb
A lib/spec/rails/example/behaviour/helper_example.rb
A lib/spec/rails/example/behaviour/model_example.rb
Updated to revision 2994.
danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins/
rspec_on_rails$ cd …/rspec
danieltenner@danbook:~/Sites/xxx.local/xxx/rails/trunk/vendor/plugins/
rspec$ svn up -r 2994
U stories/resources/test/test_case_with_should_methods.rb
U stories/resources/test/spec_and_test_together.rb
D lib/spec/interop/test/unit/testcase.rb
A lib/spec/interop/test/unit/example_group.rb
U lib/spec/interop/test.rb
U lib/spec/version.rb
U lib/spec.rb
Updated to revision 2994.

After svn-down-ing to 2994, be_nil works in my stories again.

Hope this helps someone :slight_smile:

Daniel

On 11/26/07, David C. [email protected] wrote:

Again - I’ll look at this tonight and get it working.

http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/147-patch-allow-stories-to-use-spec-matchers


Josh K.
phone: 509-979-1593
email: [email protected]
web: http://joshknowles.com

On Nov 26, 2007 2:02 PM, Josh K. [email protected] wrote:

On 11/26/07, David C. [email protected] wrote:

Again - I’ll look at this tonight and get it working.

Lighthouse - Beautifully Simple Issue Tracking

Applied - thanks Josh!

7-up everyone.

Cheers,
David