Tim Walker
2008-Nov-23 17:50 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
Sorry if this is a really basic question. Scanned the past several months archives, didn''t see it. When I am running "cucumber features" I get the error: "uninitialized constant Thing (NameError)" With step code being executed as... Given /^a thing consisting of "L1" $/ do Thing.new end I understand that this probably a basic question but it''s like cucumber isn''t loading my rails environment. Many thanks in advance. T
David Chelimsky
2008-Nov-24 14:20 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
On Sun, Nov 23, 2008 at 11:50 AM, Tim Walker <walketim at gmail.com> wrote:> Sorry if this is a really basic question. Scanned the past several > months archives, didn''t see it. > > When I am running "cucumber features" > > I get the error: > > "uninitialized constant Thing (NameError)" > > With step code being executed as... > > Given /^a thing consisting of "L1" $/ do > Thing.new > end > > I understand that this probably a basic question but it''s like > cucumber isn''t loading my rails environment. > > Many thanks in advance.Have you read and followed http://github.com/aslakhellesoy/cucumber/wikis/ruby-on-rails?> > T > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy
2008-Nov-24 15:50 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
On Sun, Nov 23, 2008 at 6:50 PM, Tim Walker <walketim at gmail.com> wrote:> Sorry if this is a really basic question. Scanned the past several > months archives, didn''t see it. > > When I am running "cucumber features" > > I get the error: > > "uninitialized constant Thing (NameError)" > > With step code being executed as... > > Given /^a thing consisting of "L1" $/ do > Thing.new > end > > I understand that this probably a basic question but it''s like > cucumber isn''t loading my rails environment. >What version/revision of cucumber? What''s in your features directory? What''s the contents of your env.rb file? What''s the full stack trace? Aslak> > Many thanks in advance. > > T > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081124/35304e40/attachment.html>
Joseph Wilk
2008-Nov-24 15:54 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
Tim Walker wrote:> Sorry if this is a really basic question. Scanned the past several > months archives, didn''t see it. > > When I am running "cucumber features" > > I get the error: > > "uninitialized constant Thing (NameError)" > > With step code being executed as... > > Given /^a thing consisting of "L1" $/ do > Thing.new > end > > I understand that this probably a basic question but it''s like > cucumber isn''t loading my rails environment. > > Many thanks in advance. > > T > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > >Sounds like your env.rb file is either not being required or it does not contain the rails require. If you have a env.rb check it requires rails @@@ ... # Sets up the Rails environment for Cucumber ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + ''/../../../config/environment'') ... @@@ Also make sure when you run the cucumber command that it either automatically (it will include siblings or below) or explicitly though a --require includes your env.rb -- Joseph Wilk http://blog.josephwilk.net
Tim Walker
2008-Nov-25 14:13 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
Thanks very much for this information guys. I got side-tracked with a dev issue and hope to have time to work on this this morning. No doubt my env.rb is jacked. What part of the install creates that? I see it in the downloaded project but not in my development project after installing cucumber. Should this like in config and is it specific to cucumber? Many thanks again as I get up to speed. Also, any chance to be a Beta read of the RSpec book? Sincerely, Tim On Mon, Nov 24, 2008 at 8:50 AM, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> > > On Sun, Nov 23, 2008 at 6:50 PM, Tim Walker <walketim at gmail.com> wrote: >> >> Sorry if this is a really basic question. Scanned the past several >> months archives, didn''t see it. >> >> When I am running "cucumber features" >> >> I get the error: >> >> "uninitialized constant Thing (NameError)" >> >> With step code being executed as... >> >> Given /^a thing consisting of "L1" $/ do >> Thing.new >> end >> >> I understand that this probably a basic question but it''s like >> cucumber isn''t loading my rails environment. > > What version/revision of cucumber? > What''s in your features directory? > What''s the contents of your env.rb file? > What''s the full stack trace? > > Aslak > >> >> Many thanks in advance. >> >> T >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Tim Walker
2008-Nov-25 14:15 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
Typo in last is confusing '' "Should this LIKE in config" should be... "Should this LIVE in config". T On Tue, Nov 25, 2008 at 7:13 AM, Tim Walker <walketim at gmail.com> wrote:> Thanks very much for this information guys. I got side-tracked with a > dev issue and hope to have time to work on this this morning. No doubt > my env.rb is jacked. What part of the install creates that? I see it > in the downloaded project but not in my development project after > installing cucumber. Should this like in config and is it specific to > cucumber? Many thanks again as I get up to speed. > > Also, any chance to be a Beta read of the RSpec book? > > Sincerely, > > Tim > On Mon, Nov 24, 2008 at 8:50 AM, aslak hellesoy > <aslak.hellesoy at gmail.com> wrote: >> >> >> On Sun, Nov 23, 2008 at 6:50 PM, Tim Walker <walketim at gmail.com> wrote: >>> >>> Sorry if this is a really basic question. Scanned the past several >>> months archives, didn''t see it. >>> >>> When I am running "cucumber features" >>> >>> I get the error: >>> >>> "uninitialized constant Thing (NameError)" >>> >>> With step code being executed as... >>> >>> Given /^a thing consisting of "L1" $/ do >>> Thing.new >>> end >>> >>> I understand that this probably a basic question but it''s like >>> cucumber isn''t loading my rails environment. >> >> What version/revision of cucumber? >> What''s in your features directory? >> What''s the contents of your env.rb file? >> What''s the full stack trace? >> >> Aslak >> >>> >>> Many thanks in advance. >>> >>> T >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >
David Chelimsky
2008-Nov-25 14:46 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
On Tue, Nov 25, 2008 at 8:13 AM, Tim Walker <walketim at gmail.com> wrote:> Thanks very much for this information guys. I got side-tracked with a > dev issue and hope to have time to work on this this morning. No doubt > my env.rb is jacked. What part of the install creates that? I see it > in the downloaded project but not in my development project after > installing cucumber. Should this like in config and is it specific to > cucumber? Many thanks again as I get up to speed. > > Also, any chance to be a Beta read of the RSpec book?Coming in December. http://www.pragprog.com/titles/achbd/the-rspec-book Cheers, David> > Sincerely, > > Tim > On Mon, Nov 24, 2008 at 8:50 AM, aslak hellesoy > <aslak.hellesoy at gmail.com> wrote: >> >> >> On Sun, Nov 23, 2008 at 6:50 PM, Tim Walker <walketim at gmail.com> wrote: >>> >>> Sorry if this is a really basic question. Scanned the past several >>> months archives, didn''t see it. >>> >>> When I am running "cucumber features" >>> >>> I get the error: >>> >>> "uninitialized constant Thing (NameError)" >>> >>> With step code being executed as... >>> >>> Given /^a thing consisting of "L1" $/ do >>> Thing.new >>> end >>> >>> I understand that this probably a basic question but it''s like >>> cucumber isn''t loading my rails environment. >> >> What version/revision of cucumber? >> What''s in your features directory? >> What''s the contents of your env.rb file? >> What''s the full stack trace? >> >> Aslak >> >>> >>> Many thanks in advance. >>> >>> T >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Tim Walker
2008-Nov-25 16:37 UTC
[rspec-users] cucumber question - uninitialized constant creating object in model
Thank you. I have the env.rb loading the environment now and am making progress. Question: In Cucumber when you''re writing code to satisfy steps and accessing the model objects directly, what support for asserts, responses, etc. do people use. (the equivalent of ActionController::TestCase and ActiveSupport::TestCase), Fixtures, etc. Many thanks, Tim On Tue, Nov 25, 2008 at 7:46 AM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Tue, Nov 25, 2008 at 8:13 AM, Tim Walker <walketim at gmail.com> wrote: >> Thanks very much for this information guys. I got side-tracked with a >> dev issue and hope to have time to work on this this morning. No doubt >> my env.rb is jacked. What part of the install creates that? I see it >> in the downloaded project but not in my development project after >> installing cucumber. Should this like in config and is it specific to >> cucumber? Many thanks again as I get up to speed. >> >> Also, any chance to be a Beta read of the RSpec book? > > Coming in December. > > http://www.pragprog.com/titles/achbd/the-rspec-book > > Cheers, > David > >> >> Sincerely, >> >> Tim >> On Mon, Nov 24, 2008 at 8:50 AM, aslak hellesoy >> <aslak.hellesoy at gmail.com> wrote: >>> >>> >>> On Sun, Nov 23, 2008 at 6:50 PM, Tim Walker <walketim at gmail.com> wrote: >>>> >>>> Sorry if this is a really basic question. Scanned the past several >>>> months archives, didn''t see it. >>>> >>>> When I am running "cucumber features" >>>> >>>> I get the error: >>>> >>>> "uninitialized constant Thing (NameError)" >>>> >>>> With step code being executed as... >>>> >>>> Given /^a thing consisting of "L1" $/ do >>>> Thing.new >>>> end >>>> >>>> I understand that this probably a basic question but it''s like >>>> cucumber isn''t loading my rails environment. >>> >>> What version/revision of cucumber? >>> What''s in your features directory? >>> What''s the contents of your env.rb file? >>> What''s the full stack trace? >>> >>> Aslak >>> >>>> >>>> Many thanks in advance. >>>> >>>> T >>>> _______________________________________________ >>>> rspec-users mailing list >>>> rspec-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >