[rspec-devel] rspec + edge rails

David Chelimsky dchelimsky at gmail.com
Fri Sep 28 22:30:39 EDT 2007


On 9/28/07, Pat Maddox <pergesu at gmail.com> wrote:
> On 9/28/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > On 9/28/07, Pat Maddox <pergesu at gmail.com> wrote:
> > > On 9/28/07, James Hughes <hughes.james at gmail.com> wrote:
> > > > On 9/28/07, Pat Maddox <pergesu at gmail.com> wrote:
> > > > > Is anyone successfully using rspec with edge rails?  I just tried to
> > Hi Pat - CURRENT is the last release, not the trunk.
> >
> > You want to get edge rspec if you're using edge rails:
> >
> > svn export svn://rubyforge.org/var/svn/rspec/trunk/rspec
> > svn export svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails
> >
> > Cheers,
> > David
> >
> > >
> > > I generated rspec and an rspec_model.  Just added two columns, name
> > > and age.  Here's the spec:
> > >
> > > describe Person do
> > >   before(:each) do
> > >     @person = Person.new :name => "Pat"
> > >   end
> > >
> > >   it "should have a name" do
> > >     @person.name.should == "Pat"
> > >   end
> > > end
> > >
> > > Running script/spec spec/model/person_spec.rb gives me
> > >
> > > /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:263:in
> > > `load_missing_constant': uninitialized constant
> > > ActionView::Helpers::JavaScriptMacrosHelper (NameError)
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in
> > > `const_missing'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/helper.rb:31
> > >         from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `gem_original_require'
> > >         from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `require'
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
> > > `require'
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in
> > > `new_constants_in'
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
> > > `require'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour.rb:8
> > >          ... 25 levels...
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:49:in
> > > `prepare!'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:19:in
> > > `run'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in
> > > `run'
> > >         from ./script/spec:4
> > >
> > >
> > > So I took out line 31 of helper.rb, run the spec again and get
> > >
> > > /Users/pergesu/work/test_app/vendor/plugins/rspec_on_rails/lib/spec/rails.rb:20:
> > > undefined method `run=' for Test::Unit:Module (NoMethodError)
> > >         from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `gem_original_require'
> > >         from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `require'
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
> > > `require'
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in
> > > `new_constants_in'
> > >         from /Users/pergesu/work/test_app/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
> > > `require'
> > >         from ./spec/models/../spec_helper.rb:5
> > >         from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `gem_original_require'
> > >         from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> > > `require'
> > >         from ./spec/models/person_spec.rb:1
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:106:in
> > > `load'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:106:in
> > > `load_specs'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:105:in
> > > `each'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:105:in
> > > `load_specs'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:49:in
> > > `prepare!'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:19:in
> > > `run'
> > >         from /Users/pergesu/work/test_app/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in
> > > `run'
> > >         from ./script/spec:4
> > >
> > >
> > > So I took out "Test::Unit.run = true" from rails.rb, run again and get
> > >
> > > baggio:~/work/test_app pergesu$ ./script/spec spec/models/person_spec.rb
> > > F
> > >
> > > 1)
> > > NameError in 'Person should have a name'
> > > undefined local variable or method `method_name' for [RSpec
> > > example]:#<Class:0x242339c>
> > > /Users/pergesu/work/test_app/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/model.rb:12:in
> > > `before_eval'
> > > ./script/spec:4:
> > >
> > > Finished in 0.015112 seconds
> > >
> > > 1 example, 1 failure
> > >
> > > What revisions do you have of rails and rspec?
> > >
> > > Pat
> > > _______________________________________________
> > > rspec-devel mailing list
> > > rspec-devel at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rspec-devel
> > >
> > _______________________________________________
> > rspec-devel mailing list
> > rspec-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-devel
> >
>
> grr, I'm retarded.  thanks :)

np

ps - your contributions to list of late have been extraordinarily
eloquent and helpful. Not bad for a retarded guy ;)

>
> Pat
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the rspec-devel mailing list