Re: [rspec-users] How to remove this deprecation warning

2011-09-01 Thread Jim Morris
I didn't think of looking in closed bugs :) I guess the fix has not made into the current release. I think this gives me enough clues as to what I need to do to fix it though, thanks ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyfor

[rspec-users] How to remove this deprecation warning

2011-09-01 Thread Jim Morris
Hi, After upgrading to rails 3.1 and rspec-rails 2.6.1 I get the following deprecation warning, however as far as I can tell I am not defining any examples before it is called. I am using the default spec_helper generated with rails g rspec:install so why this warning? Thanks ***

Re: [rspec-users] How to run example group in transaction

2011-03-04 Thread Jim Morris
In your spec_helper... RSpec.configure do |config| # setup transactional factory for sequel, when running transactional tests config.around(:each, :transactional => true) do |example| Sequel::DATABASES.first.transaction do example.run raise Sequel::Error::Rollback end en

Re: [rspec-users] Notes on upgrading from RSpec 1 to RSpec 2

2011-01-13 Thread Jim Morris
On Jan 13, 10:36 am, Kurt wrote: > Hi -- Thanks for sharing all your tips.  I couldn't understand your > line about what replaces have_text, however.  I don't see a method > called "matches" or "match"... Sorry that should be... response.body.should match(/../) it is the standard text regexp ma

Re: [rspec-users] rspec-rails-2.4.0 is released!

2011-01-02 Thread Jim Morris
usually loaded first pulls something in that you needed? Thanks On Jan 2, 10:15 pm, David Chelimsky wrote: > On Sun, Jan 2, 2011 at 11:51 PM, David Chelimsky wrote: > > On Sun, Jan 2, 2011 at 11:01 PM, Jim Morris wrote: > >> Ok I re installed rspec-rails 2.4.0 looks like my requ

Re: [rspec-users] rspec-rails-2.4.0 is released!

2011-01-02 Thread Jim Morris
2010.02/lib/ruby/gems/1.8/gems/ rspec-core-2.4.0/lib/rspec/core/runner.rb:10:in `autorun' from /opt/ruby-enterprise-1.8.7-2010.02/bin/rspec:19 On Jan 2, 8:12 pm, Jim Morris wrote: > Yes I can, the full app is onhttps://github.com/wolfmanjm/wolfmanblog_rails > althou

Re: [rspec-users] rspec-rails-2.4.0 is released!

2011-01-02 Thread Jim Morris
> The problem is with rspec-cells, but I'm not clear yet on the root > cause. Something to do with the way it's hooking itself into the > framework is failing. I totally removed rspec-cells from my gems and bundle, but I still get the same failure, so I'm not convinced it is rspec-cells, it did g

Re: [rspec-users] rspec-rails-2.4.0 is released!

2011-01-02 Thread Jim Morris
On Sun, Jan 2, 2011 at 9:09 PM, Jim Morris wrote: > > I just upgraded from 2.3.1 and I now get this error on all my specs... > > Nothing else changed and the Upgrade.md does not indicate any backward > > compatibilities unless I missed something. > > > (in /home/morri

Re: [rspec-users] rspec-rails-2.4.0 is released!

2011-01-02 Thread Jim Morris
ound(:each, :transactional => true) do |example| Sequel::DATABASES.first.transaction do example.run raise Sequel::Error::Rollback end end end # to make factory girl run with sequel class Sequel::Model def save! save(:validate=>false) end end On Jan 2, 7:46 pm, Da

Re: [rspec-users] rspec-rails-2.4.0 is released!

2011-01-02 Thread Jim Morris
I just upgraded from 2.3.1 and I now get this error on all my specs... Nothing else changed and the Upgrade.md does not indicate any backward compatibilities unless I missed something. (in /home/morris/work/ruby/rails3/wolfmanblog) /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby -S bundle exec rspec .

Re: [rspec-users] rspec 2 helper spec problems

2010-12-28 Thread Jim Morris
Never mind sorry for the noise :) Guess I shouldn't have been working so late at night ;) I left out the it block! On Dec 27, 8:39 pm, Jim Morris wrote: > Hi, I have a working application_helper_spec.rb, and now I created a > posts_helper_spec.rb in the spec/helpers directory. >

[rspec-users] rspec 2 helper spec problems

2010-12-27 Thread Jim Morris
Hi, I have a working application_helper_spec.rb, and now I created a posts_helper_spec.rb in the spec/helpers directory. But it looks like rspec is not treating it as a helper spec, the helper returns null and mocks and stubs are not recognized, and the before is not being executed, and even my sp

Re: [rspec-users] running rspec in spec/requests directory with cells fails

2010-12-22 Thread Jim Morris
 am, David Chelimsky wrote: > On Dec 22, 2010, at 2:51 AM, Jim Morris wrote: > > > Hi, not exactly sure if this is a cells bug or an rspec (or both), but > > when running a simple request spec > > from the spec/requests directory gets an error whereas running it from >

[rspec-users] running rspec in spec/requests directory with cells fails

2010-12-22 Thread Jim Morris
Hi, not exactly sure if this is a cells bug or an rspec (or both), but when running a simple request spec from the spec/requests directory gets an error whereas running it from the RAILS ROOT directory it works.. Seems it cannot find the view in the cells directory. The full project is in https://

[rspec-users] Notes on upgrading from RSpec 1 to RSpec 2

2010-12-04 Thread Jim Morris
I am trying to upgrade a Rails 2.2.2 app to Rails3, its a pain ;) Part of this is I need to upgrade all my Specs to RSpec2, as this info does not seem to be in any one place, here is a summary of what I needed to do... * needed to rename all my views from .haml to .html.haml, (or .html.erb) alth

[rspec-users] controller_name replacement?

2010-12-04 Thread Jim Morris
This his been discussed but the only definitive answer (kinda) was use... describe "a description" do system { SomeController } end However when I do that I get this error... @controller is nil: make sure you set it in your test's setup method. I used to use controller_name :somecontroll

Re: [rspec-users] Trouble making rspec-rails 2 work with webrat.

2010-11-30 Thread Jim Morris
cool that did fix it. thanks On Nov 30, 6:34 am, David Chelimsky wrote: > On Nov 29, 2010, at 8:05 PM, Jim Morris wrote: > > > > > Hi David, > > > I am using the current versions of everything rspec > > rspec (2.2.0,) > > rspec-core (2.2.1) > > rspe

Re: [rspec-users] Trouble making rspec-rails 2 work with webrat.

2010-11-29 Thread Jim Morris
group or is this an rspec/webrat/ rails3 issue? On Nov 29, 2:45 pm, David Chelimsky wrote: > On Nov 29, 2010, at 4:44 PM, David Chelimsky wrote: > > > > > > > On Nov 29, 2010, at 3:28 PM, Jim Morris wrote: > > >> Sorry I may have been unclear > > &

Re: [rspec-users] Trouble making rspec-rails 2 work with webrat.

2010-11-29 Thread Jim Morris
Rack::Test::Methods It now sees last_response but doesn't get a respnose from visit (That may be a different errror). So bottom line is using the latest rails/rspec/webrat does not work out of the box. On Nov 29, 7:18 am, David Chelimsky wrote: > On Nov 29, 2010, at 4:58 AM, Jim

Re: [rspec-users] Trouble making rspec-rails 2 work with webrat.

2010-11-29 Thread Jim Morris
r # comes from the p response.body On Nov 29, 7:18 am, David Chelimsky wrote: > On Nov 29, 2010, at 4:58 AM, Jim Morris wrote: > > > > > Ok adding > > > include Rack::Test::Methods > > > to my spec_helper changed the error to > > >    Failure/Error: visit

Re: [rspec-users] Trouble making rspec-rails 2 work with webrat.

2010-11-29 Thread Jim Morris
Ok adding include Rack::Test::Methods to my spec_helper changed the error to Failure/Error: visit "/" No response yet. Request a page first. # /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rack- test-0.5.6/lib/rack/mock_session.rb:51:in `last_response' # /opt/ruby-

Re: [rspec-users] Trouble making rspec-rails 2 work with webrat.

2010-11-29 Thread Jim Morris
I don't get the stack level too deep but I do get undefined method `last_response' for # Which was supposed to be fixed ages ago. So did one fix break another? I have webrat using :rack config rspec 2.2.0, rspec-rails 2.2.0, webrat 0.7.2, rails 3.0.3 It looks to me like the webrat rack adapt

[rspec-users] [Cucumber] Using Cucumber to test Erlang servers directly

2009-05-02 Thread Jim Morris
I don't know if this will interest anyone, but I thought it was a pretty cool use of Cucumber :) I've posted a Blog article on how I use Cucumber to test an Erlang Server directly by talking to my Erlang Nodes. http://blog.wolfman.com/articles/2009/5/2/using-cucumber-to-test-erlang-servers It us

[rspec-users] [Cucumber] how to get name from scenario hook?

2009-05-01 Thread Jim Morris
Hi, Given the hook: After do |scenario| end How do I get the name of the scenario from the scenario parameter? scenario.name doesn't work, and I looked through the source code and it was not immediately obvious to me. Thanks ___ rspec-users mailing

[rspec-users] Background and scenario outline interaction

2009-04-24 Thread Jim Morris
Hi, I was surprised by this so I suspect it may be a bug. I have a Scenario Outline, and a Background in my Feature and nothing else, The Background got executed 1 more time than expected. Details are the Scenario Outline had 4 entries in the table, so I expected 4 scenarios to get executed, an

Re: [rspec-users] [Cucumber, Merb, Webrat] undefined method 'response' for

2009-02-13 Thread Jim Morris
deimos1986 wrote: > Hi Jim, > Just want to say thanks for fixing this. It blocked me for a day > trying to figure out what broke. Any chance of trying to get this > pulled into david's branch as most tutorials reference his branch. > > Cheers, > Matt It was Justin, I just benefited from his work.

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-07 Thread Jim Morris
Yet another way to do fixtures/factories is a hybrid that I outline in my blog, its basically what I do. http://blog.wolfman.com/posts/42 Basically I can't use the existing libraries as I am not using ActiveRecord. On Feb 5, 8:17 am, Ben Mabey wrote: > David Chelimsky wrote: > > I highly recom

Re: [rspec-users] Fixjour and others

2009-02-07 Thread Jim Morris
Well sometimes one can't use an existing library becuase of some reason or other, like in my case not using ActiveRecord. So I came up with yet another way to do it, I think it is a hyvrid between Fixtures and Factories. outlined here... http://blog.wolfman.com/posts/42 On Feb 7, 8:16 am, Jay

Re: [rspec-users] [Cucumber, Merb, Webrat] undefined method 'response' for

2009-02-01 Thread Jim Morris
Jim Morris wrote: > Justin Smestad wrote: >> Daniel, I have fixed this in my fork: >> http://github.com/jsmestad/merb_cucumber/tree/master >> > > I still get the same error after installing > jsmestad-merb_cucumber-0.5.1.3 from gems.github.com > Did the versi

Re: [rspec-users] [Cucumber, Merb, Webrat] undefined method 'response' for

2009-01-31 Thread Jim Morris
Justin Smestad wrote: > Daniel, I have fixed this in my fork: > http://github.com/jsmestad/merb_cucumber/tree/master > I still get the same error after installing jsmestad-merb_cucumber-0.5.1.3 from gems.github.com Did the version get bumped OK? or do I need to clone and build locally? Thanks -

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-11 Thread Jim Morris
...etc... end I have a custom hpricot matcher which provides the have_xpath matcher Yes this is stateful, but the @hdoc variable is central to the tests and I don't see any other way to carry the response from the When to the Then, unless you combine the step in a then and skip the when, s

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-10 Thread Jim Morris
e have_xpath matcher Yes this is stateful, but the @hdoc variable is central to the tests and I don't see any other way to carry the response from the When to the Then, unless you combine the step in a then and skip the when, so you don't have to carry state

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
ion state which must change either way or you're not testing anything. Thats true in that case. I also wouldn't do what you show in the second case. If I can get the result from the API or the database I would. In my case I store data between states that I

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
o the same scope as the steps. Good that'll make the transition easier I hope. -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
Rails I would undoubtedly do it the way you suggest :) Matt Wynne wrote: On 9 Sep 2008, at 19:52, Jim Morris wrote: aslak hellesoy wrote: The debate seems to be whether step definitions should be stateful or not. In practice this is achieved by setting one or more @variables in a step and

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
succeeed due to a previously successful scenario. I'd definitely be interested in better ways to do this though, as I hate passing global variables around (as I said in an earlier post I can't use @variable because the before_scenario does not seem to have access to the same scope as t

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-09 Thread Jim Morris
ever, you hear me? Hmmm well OK I'll try to never use them ;) -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Best practices for sharing state between story steps?

2008-09-08 Thread Jim Morris
hen to check the database actually got setup the way I expected by a previous When, as well as checking the returned XML from the Rest-API call. As always YMMV -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Cucumber table docs?

2008-08-21 Thread Jim Morris
Hi, I'm looking at the examples in cucumber, and I see the fit-like tables, but for the life of me I don't see how they map to the steps, ie how does the table data get fitted into the steps parameters. Maybe some documentation for these tables is in order ;) Thanks Jim -- Jim Mo

Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-20 Thread Jim Morris
u] end $last_error= nil $roomid= nil $roomobjectid= nil $last_doc= nil $bagid= nil end -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-19 Thread Jim Morris
o. I'd like to have a before story and after story as well as a before scenario and after scenario. Right now I do global setup for a story, and cleanup when the story is done. I also do a setup before each scenario as well. It would be nice to have the ability to do both. Thanks -- Jim

Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-18 Thread Jim Morris
sts is not a good use of my time. If you were to reword deprecation to frozen I'd be a lot happier :) then I can leave my old tests alone and use cucumber for new tests. -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-18 Thread Jim Morris
o use the latest RSpec. I suggest that cucumber stay separate, and RSpec keep the story runner, either as core or as an add on. Deprecating something that is being used extensively will not make your users happy. -- Jim Morris, http://blog.wolfma

Re: [rspec-users] Running all stories in a directory

2008-07-24 Thread Jim Morris
Jim Morris wrote: I have a bunch on non-rails stories, and I want to run them all with either a rake task or a script. I tried the all.rb approach from rails, but is doesn't seem to work. I do this basically... dir = File.dirname(__FILE__) tests= [] %w(story1 story2 story3).each

[rspec-users] Running all stories in a directory

2008-07-24 Thread Jim Morris
tests << File.join(dir, f) + ".rb" end puts "Testing: #{tests.join(',')}" tests.each do |file| require file end Should this work? Some of the stories run OK, but some seem to not be setup properly, they run fine if run individually from the command line

Re: [rspec-users] Executing multiple rspec scripts

2008-07-12 Thread Jim Morris
byforge.org/mailman/listinfo/rspec-users -- Regards, Robert -------- ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] rake task to run stories?

2008-07-10 Thread Jim Morris
ntegration testing seems to work very nicely, thank you! -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] is there a plain format output for stories?

2008-07-09 Thread Jim Morris
f' @output.flush @scenario_ok = false end def collected_steps(steps) end def method_missing(sym, *args, &block) #:nodoc: # noop - ignore unknown messages end end -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] is there a plain format output for stories?

2008-07-07 Thread Jim Morris
When running a lot of stories from a script it would be nice to have the plain format of dots rather than the verbose story descriptions. Is there a way to do this? I tried -f p but it ignored it. Thanks -- Jim Morris, http://blog.wolfman.com

[rspec-users] Testing HAML in helper rspec

2008-07-03 Thread Jim Morris
end nil end I also updated my blog post on this topic to cover the new syntax... http://blog.wolfman.com/articles/2007/07/14/using-rspec-to-test-haml-helpers -- Jim Morris, http://blog.wolfman.com ___ rspec-users mailing list rspec-users@rubyforg

Re: [rspec-users] unable to access flash from rails helper spec since upgrade to 1.1.4

2008-07-03 Thread Jim Morris
_________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users -- Jim Morris, http://blog.wolfman.com _______ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/m

Re: [rspec-users] unable to access flash from rails helper spec since upgrade to 1.1.4

2008-07-02 Thread Jim Morris
into the HelperObject? I just don't know how to do that. I am using the latest version of HAML but I am still using rails 1.2.6 Any ideas? Thanks Jim David Chelimsky wrote: On Jul 2, 2008, at 7:12 PM, Jim Morris wrote: Hi, Many moons ago I wrote this blog entry... http://blog.w

[rspec-users] unable to access flash from rails helper spec since upgrade to 1.1.4

2008-07-02 Thread Jim Morris
when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[] /.../app/helpers/application_helper.rb:23:in `test_flash' ... flash is nil, this used to work, so what is the new magic incantation to get this to

Re: [rspec-users] Story for Rest

2008-06-20 Thread Jim Morris
Attached is a custom matcher using hpricot, (and the spec for it) it has a "have_xpath matcher for checking xml. I has an earlier one using rexml but hpricot is faster, you can read about that here http://blog.wolfman.com/articles/2008/01/02/xpath-matchers-for-rspec This new hpricot one i

Re: [rspec-users] Reusing story snippets

2008-06-18 Thread Jim Morris
or the Givens I > think it's perfectly acceptable to just "make it so". Whether that's putting > some value in a session or shoving some data in a table. It's only the When > steps that should be duty bound to operate the app like a regular user, > because that&

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
fter(&block) setup_listener(listener) end Use it in your story ruby file thusly... require File.join(File.dirname(__FILE__), "spec_helper") # execute this code before story runs before_story do #stuff end # execute this code after the story runs after_story do # more stuff en

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
.Started story #{title}" end def story_ended(title, narrative) puts "...Ended story #{title}" end end Spec::Story::Runner.register_listener(MyListener.new) On Jun 17, 3:38 pm, Ben Mabey <[EMAIL PROTECTED]> wrote: > Jim Morris wrote: > > Hi, Not top posti

[rspec-users] Confused - which is the correct Story API

2008-06-17 Thread Jim Morris
Hi, I am confused (a normal state for me) about the State-Of-The-Art Story API to use. examples/calculator.rb has one syntax, the Blogs have another Syntax, so do the various tutorials. I realize that Stories are ongoing work, but it would be nice if there were something I could refer to to make

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
Hi, Not top posting (although I prefer it ;) > > Cool. Are you talking directly through ruby constructs or through a > browser tool like selenium? I have a helper that makes posts and gets and deletes and puts directly to the server which is implements a mostly REST-ful API and written in Java. I

Re: [rspec-users] Reusing story snippets

2008-06-17 Thread Jim Morris
narrative) puts "...Ended story #{title}" end end Spec::Story::Runner.register_listener(MyListener.new) Then I define my steps using StepGroup.new Then the Scenarios It seems to work although not very intuitive :) I'd prefer a before(:all) and after(:all) On Jun 16, 11:5

Re: [rspec-users] Reusing story snippets

2008-06-16 Thread Jim Morris
pm, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jun 16, 2008, at 6:18 PM, Jim Morris wrote: > > > Along similar lines is there a way to do the equivalent of > > before(:all) and after(:all) or after(:each) in stories? > > > Basically I have a similar situation as ab

Re: [rspec-users] Reusing story snippets

2008-06-16 Thread Jim Morris
Along similar lines is there a way to do the equivalent of before(:all) and after(:all) or after(:each) in stories? Basically I have a similar situation as above, but I need to make sure the user is logged out after each scenario. or that the user is logged in once at the start of all scenarios th