Re: [rspec-users] auto test?

2009-05-19 Thread Scott Taylor
Diwakar, ANGLER - EIT wrote: I am still getting the same error c:/ruby/lib/ruby/gems/1.8/gems/ZenTest-4.0.0/lib/autotest.rb:194:in `expand_path ': couldn't find HOME environment -- expanding `~/.autotest' (ArgumentError) from c:/ruby/lib/ruby/gems/1.8/gems/ZenTest-4.0.0/lib/autotest.r

Re: [rspec-users] getting strings in results

2009-05-19 Thread David Chelimsky
On Wed, May 20, 2009 at 12:12 AM, Diwakar, ANGLER - EIT wrote: > Earlier I used rspec for a small module in which I could see the string used > in the example displayed in the results > > for eg. > >  1.should be success >  2. should be redirect(failed) > > 2 examples, 1 failure > > Now I upgraded

[rspec-users] getting strings in results

2009-05-19 Thread Diwakar, ANGLER - EIT
Earlier I used rspec for a small module in which I could see the string used in the example displayed in the results for eg. 1.should be success 2. should be redirect(failed) 2 examples, 1 failure Now I upgraded the rails version and getting the results as 2 examples, 1 failure. what

Re: [rspec-users] auto test?

2009-05-19 Thread Diwakar, ANGLER - EIT
I am still getting the same error c:/ruby/lib/ruby/gems/1.8/gems/ZenTest-4.0.0/lib/autotest.rb:194:in `expand_path ': couldn't find HOME environment -- expanding `~/.autotest' (ArgumentError) from c:/ruby/lib/ruby/gems/1.8/gems/ZenTest-4.0.0/lib/autotest.rb:194:in `initialize'

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread Luke Melia
On May 19, 2009, at 10:43 PM, Luke Melia wrote: On May 19, 2009, at 7:04 PM, aslak hellesoy wrote: I'm convinced. We'll add an AfterStep hook. Do you want to give a stab at a patch? Start by writing a feature - see features/after_block_exceptions.feature for a good example of the style we li

Re: [rspec-users] auto test?

2009-05-19 Thread Scott Taylor
Diwakar, ANGLER - EIT wrote: I am new to rspec I am using ZenTest gem. I ran the autospec from the root directory. I am getting the below error. c:/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/autotest.rb:190:in `expand_path': couldn't find HOME environment -- expanding `~/.autotest' (A

[rspec-users] auto test?

2009-05-19 Thread Diwakar, ANGLER - EIT
I am new to rspec I am using ZenTest gem. I ran the autospec from the root directory. I am getting the below error. c:/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/autotest.rb:190:in `expand_path': couldn't find HOME environment -- expanding `~/.autotest' (ArgumentError) from c:/ru

Re: [rspec-users] autotest?

2009-05-19 Thread Scott Taylor
Denis Haskin wrote: Hmm. Okay, tried that but: $ autospec (Not running features. To run features in autotest, set AUTOFEATURE=true.) loading autotest/rails_rspec Autotest style autotest/rails_rspec doesn't seem to exist. Aborting. I'm running my rails rspec examples just fine manually... d

[rspec-users] Issue with jruby and cucumber step with 4 parameters

2009-05-19 Thread Korny Sietsma
Hi - sorry for the cross-list post, but this issue happens only with cucumber and jruby, and I'm not 100% sure which has the problem. It doesn't happen with non-j ruby though. Versions: cucumber 0.2.3 jruby 1.2.0 on Ubuntu amd64 When I have a cucumber feature with a "Then" step: (well, really

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread Ben Mabey
Ben Mabey wrote: Luke Melia wrote: Any further thoughts on this, Aslak? I'd prefer to go with a solution in line with the future direction of Cucumber if possible. Cheers, Luke Have you seen what Matt added recently? https://rspec.lighthouseapp.com/projects/16211/tickets/330-gracefully-hand

Re: [rspec-users] autotest?

2009-05-19 Thread Denis Haskin
Hmm. Okay, tried that but: $ autospec (Not running features. To run features in autotest, set AUTOFEATURE=true.) loading autotest/rails_rspec Autotest style autotest/rails_rspec doesn't seem to exist. Aborting. I'm running my rails rspec examples just fine manually... dwh Ben Mabey wrote: R

Re: [rspec-users] autotest?

2009-05-19 Thread Ben Mabey
Denis Haskin wrote: Can someone point me to some decent doc on autotest? Everything I'm finding seems either pretty old, or says "autotest and rspec work out of the box", which it isn't for me... I installed the grosser-autotest gem (just guessing) and when I run autotest it only runs (legac

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread Ben Mabey
Luke Melia wrote: Any further thoughts on this, Aslak? I'd prefer to go with a solution in line with the future direction of Cucumber if possible. Cheers, Luke Have you seen what Matt added recently? https://rspec.lighthouseapp.com/projects/16211/tickets/330-gracefully-handle-exceptions-in-a

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread Luke Melia
On May 19, 2009, at 7:04 PM, aslak hellesoy wrote: I'm convinced. We'll add an AfterStep hook. Do you want to give a stab at a patch? Start by writing a feature - see features/after_block_exceptions.feature for a good example of the style we like... Sounds good. I'll give it a whirl tonight.

[rspec-users] autotest?

2009-05-19 Thread Denis Haskin
Can someone point me to some decent doc on autotest? Everything I'm finding seems either pretty old, or says "autotest and rspec work out of the box", which it isn't for me... I installed the grosser-autotest gem (just guessing) and when I run autotest it only runs (legacy) test/unit tests.

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread Matt Wynne
On 20 May 2009, at 00:04, aslak hellesoy wrote: Any further thoughts on this, Aslak? I'd prefer to go with a solution in line with the future direction of Cucumber if possible. Sorry, forgot to get back to you Luke. I'm convinced. We'll add an AfterStep hook. Do you want to give a stab at

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread aslak hellesoy
> Any further thoughts on this, Aslak? I'd prefer to go with a solution in > line with the future direction of Cucumber if possible. > Sorry, forgot to get back to you Luke. I'm convinced. We'll add an AfterStep hook. Do you want to give a stab at a patch? Start by writing a feature - see feature

Re: [rspec-users] [Cucumber] Fail a scenario from After or AfterStep

2009-05-19 Thread Luke Melia
Any further thoughts on this, Aslak? I'd prefer to go with a solution in line with the future direction of Cucumber if possible. Cheers, Luke On May 15, 2009, at 5:12 PM, Luke Melia wrote: On May 15, 2009, at 3:36 PM, aslak hellesoy wrote: Thanks for doing that. I have one more favour to a

[rspec-users] Problem with testing Rails action that uses return keyword

2009-05-19 Thread szimek
Hi, I'm trying to test Rails action that looks like this: def create unless facebook_session authentication_failed and return end ... @facebook_user = facebook_session.user ... end authentication_failed method redirects to '/'. The test looks like this: it 'should call authentica

Re: [rspec-users] unexpected message expectations issue

2009-05-19 Thread David Chelimsky
On Tue, May 19, 2009 at 2:50 PM, Barun Singh wrote: > Suppose a User has many Items, and I want to spec that when a user is > destroyed its associated items are destroyed.  I'm seeing some unexpected > behavior: > > describe User do >   before(:each) do >     @user = create_user   # helper method

Re: [rspec-users] RSpec for Rails plugin

2009-05-19 Thread David Chelimsky
On Tue, May 19, 2009 at 11:54 AM, Sarah Allen wrote: > I'm trying to write specs to test a Rails plugin and I'm not clear on > what needs to be installed and required.  Works fine for many specs, but > view testing fails (i.e. anything relying rspec-rails over just rspec). > > In other words, how

[rspec-users] unexpected message expectations issue

2009-05-19 Thread Barun Singh
Suppose a User has many Items, and I want to spec that when a user is destroyed its associated items are destroyed. I'm seeing some unexpected behavior: describe User do before(:each) do @user = create_user # helper method that actually creates & saves a user @item = create_item @

Re: [rspec-users] [RSpec, Rails] POST create action spec and before_filter

2009-05-19 Thread Tero Tilus
2009-05-19 10:22, Florent Florent: > BTW how can I spec that my @context is correctly set by my filter? How can you tell from _outside_ if the context is properly set or not? What does your controller use the context for? And what happens if the controller does or doesn't know about the context?

Re: [rspec-users] When to stub_model?

2009-05-19 Thread Matt Wynne
On 19 May 2009, at 18:11, Matt Wynne wrote: On 19 May 2009, at 14:53, Lee Longmore wrote: I am trying to specify a controller with RSpec for the first time. I have been using mock_model to date but, given that the models are fully implemented, I am wondering if I should be using stub_mode

[rspec-users] RSpec for Rails plugin

2009-05-19 Thread Sarah Allen
I'm trying to write specs to test a Rails plugin and I'm not clear on what needs to be installed and required. Works fine for many specs, but view testing fails (i.e. anything relying rspec-rails over just rspec). In other words, how can I use the rspec-rails gem to test a plugin? Thanks, Sarah

Re: [rspec-users] When to stub_model?

2009-05-19 Thread Matt Wynne
On 19 May 2009, at 14:53, Lee Longmore wrote: I am trying to specify a controller with RSpec for the first time. I have been using mock_model to date but, given that the models are fully implemented, I am wondering if I should be using stub_model. Based on what I have read, I am struggling

Re: [rspec-users] [RSpec, Rails] POST create action spec and before_filter

2009-05-19 Thread Florent Florent
2009/5/19 Florent Florent > > > 2009/5/19 Tero Tilus > >> Moreover the "should >> set @context" is imo a spec smell (even though it's in description >> string), because it refers to internal state of a PagesController >> instance, which you should not be interested in, but the external >> behav

Re: [rspec-users] Forum.count.should, should doesn't work?

2009-05-19 Thread David Chelimsky
On Tue, May 19, 2009 at 10:09 AM, Zhenning Guan wrote: > Scenario: List Tasks >  Then I should have 3 forums > - > > Then /^I should have ([0-9]+) forums$/ do |counts| >  Forum.count.should == counts.to_i > end > > >  When I go to the homepage   # > features/step_definitions/webra

Re: [rspec-users] [RSpec, Rails] POST create action spec and before_filter

2009-05-19 Thread Florent Florent
2009/5/19 Tero Tilus > 2009-05-18 21:40, Florent Florent: > > I have this controller: http://pastie.org/482270 > > I wrote this spec: http://pastie.org/482273 > > There are a few spots which draw my attention. At spec line 4 you > create a mock Page with #save that always fails (succesfull save

[rspec-users] Forum.count.should, should doesn't work?

2009-05-19 Thread Zhenning Guan
Scenario: List Tasks Then I should have 3 forums - Then /^I should have ([0-9]+) forums$/ do |counts| Forum.count.should == counts.to_i end When I go to the homepage # features/step_definitions/webrat_steps.rb:10 Then I should have 3 forums # features/step_definitions

Re: [rspec-users] Error in executing controller spec

2009-05-19 Thread David Chelimsky
On Tue, May 19, 2009 at 9:04 AM, Amit Kulkarni wrote: > Hi, > > Thanks for quick response > > My channels_controller_spec.rb file is inside controller spec only > i.e. PROJECT_ROOT/spec/controllers/channels_controller_spec.rb. > > As per your suggestion i removed the setup method and moved > user_

Re: [rspec-users] Error in executing controller spec

2009-05-19 Thread Amit Kulkarni
Hi, Thanks for quick response My channels_controller_spec.rb file is inside controller spec only i.e. PROJECT_ROOT/spec/controllers/channels_controller_spec.rb. As per your suggestion i removed the setup method and moved user_attributes under example groups. but i am getting the same error whi

[rspec-users] When to stub_model?

2009-05-19 Thread Lee Longmore
I am trying to specify a controller with RSpec for the first time. I have been using mock_model to date but, given that the models are fully implemented, I am wondering if I should be using stub_model. Based on what I have read, I am struggling to understand the advantages that stub_model over

Re: [rspec-users] Error in executing controller spec

2009-05-19 Thread David Chelimsky
On Tue, May 19, 2009 at 3:30 AM, Amit Kulkarni wrote: > Ruby version : 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] > rspec - 1.2.4 > rails - 2.1.2 > OS - Vista Home > I am running a single file by the command > spec channels_controller(filename)_spec.rb Where is this file? For rspec-rails to k

Re: [rspec-users] Cucumber rake/webrat issue.

2009-05-19 Thread Matthew Van Horn
On May 18, 2009, at 3:08 PM, Ben Mabey wrote: Matthew Van Horn wrote: I'm probably missing something really obvious, but I just upgraded cucumber, rspec/rails, and webrat on a project, and for some reason, cucumber is not seeing any of the webrat steps (or bmabey's email steps) when runni

Re: [rspec-users] Skipping the testscenario based on Given block execution.

2009-05-19 Thread Denis Haskin
This seems like a really bad practice when writing tests, and I'm having trouble imagining a situation where this would be justified. If "sometimes the precondition fails" that means on each test run you won't know whether the test actually ran or not, and thus whether the test succeeds or fai

Re: [rspec-users] Skipping the testscenario based on Given block execution.

2009-05-19 Thread Joseph Wilk
Anil Gollaa wrote: Hi, I think i am not clear. My query is while running the testcases, Some times precondition of testcase fails, when precondition itself fails there is no point in executing the testcase further. so , is there any way in cucumber to skip execution of scenario when preconditio

Re: [rspec-users] Skipping the testscenario based on Given block execution.

2009-05-19 Thread aslak hellesoy
> Hi, > I think i am not clear. > My query is while running the testcases, > Some times precondition of testcase fails, when precondition itself > fails there is no point in executing the testcase further. > so , is there any way in cucumber to skip execution of scenario when > precondition of test

Re: [rspec-users] Skipping the testscenario based on Given block execution.

2009-05-19 Thread Anil Gollaa
Hi, I think i am not clear. My query is while running the testcases, Some times precondition of testcase fails, when precondition itself fails there is no point in executing the testcase further. so , is there any way in cucumber to skip execution of scenario when precondition of testcase fails.

Re: [rspec-users] Error in executing controller spec

2009-05-19 Thread Amit Kulkarni
Ruby version : 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] rspec - 1.2.4 rails - 2.1.2 OS - Vista Home I am running a single file by the command spec channels_controller(filename)_spec.rb Contents of the file: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') def setup @c