Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Tero Tilus
2009-02-12 21:27, Mark Wilden: > It seems logical that #errors_on would call valid? Otherwise, how > would it know? ...and that's exactly what I thought too. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-use

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Scott Taylor
Mark Wilden wrote: It seems logical that #errors_on would call valid? Otherwise, how would it know? That intuitively makes sense. The reason the whole issue is confusing is because of AR's behaviour: >> User.new.valid? => false >> User.new.errors.to_a => [] errors_on(:foo) looks like it'l

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Pat Maddox
On Thu, Feb 12, 2009 at 8:31 PM, Tero Tilus wrote: > 2009-02-12 15:42, Pat Maddox: >>> The fact that you are asking this shows that we're violating the >>> principle of least surprise. >> >> Yes it's a surprise > > How do you know #errors_on not implicitly validating wouldn't be > bigger surprise?

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Mark Wilden
It seems logical that #errors_on would call valid? Otherwise, how would it know? ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Tero Tilus
2009-02-12 15:42, Pat Maddox: >> The fact that you are asking this shows that we're violating the >> principle of least surprise. > > Yes it's a surprise How do you know #errors_on not implicitly validating wouldn't be bigger surprise? Say 30 (instead of three now surprised) people would be surpr

Re: [rspec-users] how to write complex matchers

2009-02-12 Thread Yury Kotlyarov
Yury Kotlyarov wrote: SOLVED! just need to pass matched result to inner block. gist: http://gist.github.com/62562 Many thanks, Yury I was wrong. It yields just one last line from the inner block. It passes following: it "should have form to create a new user" do render '/users/new'

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Pat Maddox
On Thu, Feb 12, 2009 at 11:59 AM, David Chelimsky wrote: > On Feb 12, 2009, at 1:03 PM, Nick Hoffman wrote: > >> Does RSpec automatically call #valid? on ActiveRecord models? >> >> For instance, when this example is run: >> >> it 'should reject a nil value' do >> @form = TimeShiftForm.new :file

Re: [rspec-users] issues with the trunk of rspec-rails

2009-02-12 Thread Nathan Wilmes
Thanks for making the other fixes! I don't have a 'have_tag' example handy (replaced all the instances with more compact with_tag syntax).. I'll try to get to it later today and send it to you personally. =N On Feb 11, 8:40 pm, David Chelimsky wrote: > On Wed, Feb 11, 2009 at 2:52 PM, nat...@piv

Re: [rspec-users] how to write complex matchers

2009-02-12 Thread Yury Kotlyarov
SOLVED! just need to pass matched result to inner block. gist: http://gist.github.com/62562 Many thanks, Yury ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread David Chelimsky
On Feb 12, 2009, at 1:03 PM, Nick Hoffman wrote: Does RSpec automatically call #valid? on ActiveRecord models? For instance, when this example is run: it 'should reject a nil value' do @form = TimeShiftForm.new :file => nil puts "@form.errors.count = <<#...@form.errors.count}>>" @form.sho

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Pat Maddox
On Thu, Feb 12, 2009 at 11:03 AM, Nick Hoffman wrote: > Does RSpec automatically call #valid? on ActiveRecord models? > > For instance, when this example is run: > > it 'should reject a nil value' do > @form = TimeShiftForm.new :file => nil > > puts "@form.errors.count = <<#...@form.errors.count

[rspec-users] Is #valid? automatically called?

2009-02-12 Thread Nick Hoffman
Does RSpec automatically call #valid? on ActiveRecord models? For instance, when this example is run: it 'should reject a nil value' do @form = TimeShiftForm.new :file => nil puts "@form.errors.count = <<#...@form.errors.count}>>" @form.should have(1).error_on :file puts "@form.errors.c

Re: [rspec-users] [RSpec] mock_model not returning a mock

2009-02-12 Thread Nick Hoffman
Ack, that subject is completely wrong! I forgot to update it after re- writing the email. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] [RSpec] mock_model not returning a mock

2009-02-12 Thread Nick Hoffman
I'm experiencing some strange behaviour with an ActiveRecord model object. I'm trying to spec that a mocked AR object, @form, has an error on the "file" attribute. I've confirmed that there *is* an error on the "file" attribute, because I print out the error. However, the spec fails, sayi

Re: [rspec-users] Problem with refresh_specs

2009-02-12 Thread Nick Hoffman
On 31/01/2009, at 1:45 AM, jschank wrote: Hello, I recently unpacked the latest (1.1.12) rspec and rspec rails in my applicaiton. When I run my specs I get: config.gem: Unpacked gem rspec-1.1.12 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. config.gem: Unpa

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-12 Thread David Chelimsky
On Thu, Feb 12, 2009 at 9:25 AM, James Byrne wrote: Pat Maddox wrote: You are completely out of line even suggesting that David is selfish or unprofessional. Do you have any clue how many changes he HASN'T made because it would break backwards compatibility? How much effort goes into sensi

Re: [rspec-users] how to write complex matchers

2009-02-12 Thread Yury Kotlyarov
David Chelimsky wrote: On Thu, Feb 12, 2009 at 5:52 AM, Yury Kotlyarov wrote: Hi, I am trying to write custom matcher which accepts block to spec views with forms/fieldsets/inputs eg view: --- Personal Information First name ... spec: --- it "shou

Re: [rspec-users] Sorry if this is a stupid question

2009-02-12 Thread Beaton, Malcolm
I installed it via the Gem package manager ? The version I have installed is cucumber-0.1.16 And I have just re written the features file as suggested in the link and it works Weird that the addition in the examples works even though it is in the older format?? Thanks Heaps - I can now

Re: [rspec-users] Problem with refresh_specs

2009-02-12 Thread Jack Phelps
I am getting the same error with version 2.2.2; I'm testing out Heroku right now and am not sure of my ability to install it manually but will try. I'm not especially experienced with any of this, so if anyone's got any tips they're welcome :) -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] exemplary way to show a list is sorted?

2009-02-12 Thread James Byrne
Pat Maddox wrote: > > You are completely out of line even suggesting that David is selfish > or unprofessional. Do you have any clue how many changes he HASN'T > made because it would break backwards compatibility? How much effort > goes into sensibly deprecating stuff? The work he does to kee

Re: [rspec-users] Sorry if this is a stupid question

2009-02-12 Thread Matt Wynne
Those features look out of date to me. The Scenarios / More Examples format has been deprecated in the latest version on Github. Which version of cucumber are you using? Try this instead: http://wiki.github.com/aslakhellesoy/cucumber/scenario-outlines On 12 Feb 2009, at 12:01, Beaton, Malcol

Re: [rspec-users] how to write complex matchers

2009-02-12 Thread David Chelimsky
On Thu, Feb 12, 2009 at 5:52 AM, Yury Kotlyarov wrote: > Hi, > > I am trying to write custom matcher which accepts block to spec views with > forms/fieldsets/inputs eg > > view: > --- > > > Personal Information > > > First name > > > ... > > > > > spec: > -

[rspec-users] how to write complex matchers

2009-02-12 Thread Yury Kotlyarov
Hi, I am trying to write custom matcher which accepts block to spec views with forms/fieldsets/inputs eg view: --- Personal Information First name ... spec: --- it "should have form with input fields" do render ... response.should have_form(

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

2009-02-12 Thread Jai-gouk Kim
Justin Smestad wrote: > Daniel, I have fixed this in my fork: > http://github.com/jsmestad/merb_cucumber/tree/master > Thanks! IT WORKS! -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.or

Re: [rspec-users] Sorry if this is a stupid question

2009-02-12 Thread Beaton, Malcolm
Hi everyone I am trying to run the CS examples using Iron ruby/ cucumber from the download and have hit a really irritating snag I have added a subtract method to the CS calculator - Re compiled - Added a features file for it and when I run I get the following Scenario: subtra

Re: [rspec-users] Rspec approach to test model

2009-02-12 Thread Joaquin Rivera Padron
kaleem, method new does not run your model validations, neither does your provided activate! implementation. but save indeed does. my guess is your mixing several contexts (cases, situations) in your single spec. Try decoupling all with more granular examples and you'll get to save shore :-) cheers