Re: [rspec-users] Testing the <=> operator

2010-03-15 Thread David Chelimsky
On Mar 15, 2010, at 11:16 PM, Chris DiMartino wrote: > I'm having trouble getting rspec to allow me to test my Comparable class. I > would like to test the <=> method, but rspec is giving me unexpected results: > > @hand = Hand.new('R') > @other_hand = Hand.new('S') > @hand.should be > @other_h

[rspec-users] Testing the <=> operator

2010-03-15 Thread Chris DiMartino
I'm having trouble getting rspec to allow me to test my Comparable class. I would like to test the <=> method, but rspec is giving me unexpected results: @hand = Hand.new('R') @other_hand = Hand.new('S') @hand.should be > @other_hand expected > #, got # Shouldn't that test be checking for the c

Re: [rspec-users] Is share_examples_for deprecated?

2010-03-15 Thread Nick Hoffman
emdub wrote: > I think what is easiest/cleanest in the code should prevail :) I > personally like "shared_examples_for", but can easily adapt to > whatever decision is made. > > On a semi-related note. Where do I require my shared specs so > it_should_behave_like can find my shared example groups?

Re: [rspec-users] Is share_examples_for deprecated?

2010-03-15 Thread emdub
I think what is easiest/cleanest in the code should prevail :) I personally like "shared_examples_for", but can easily adapt to whatever decision is made. On a semi-related note. Where do I require my shared specs so it_should_behave_like can find my shared example groups? Is there any convention

[rspec-users] Problwm with Webrat and Selenium

2010-03-15 Thread Rails Learner
Hello Everyone, I am having problem running Webrat steps through Firefox using Selenium. I doesn't give me any error, but it never does anything. Well, I am using Windows XP (I know) Here are the gems I am using: cucumber (0.6.2) cucumber-rails (0.3.0, 0.2.4) database_cleaner (0.5.0, 0.4.3) m

Re: [rspec-users] spec-ing a nested object is saved on the specs of the object it is nested into

2010-03-15 Thread Joaquin Rivera Padron
thanks for your reply David, what worried me (well, got me thinking) was having to put on A's specs too much knowledge about when B's attributes were valid or not. I ended up doing more or less what you expose, but only: * using nil as the invalid input * using one valid combination for the valid o

Re: [rspec-users] spec-ing a nested object is saved on the specs of the object it is nested into

2010-03-15 Thread David Chelimsky
On Fri, Mar 12, 2010 at 7:45 AM, Joaquin Rivera Padron wrote: > hi there, > I have a Rails model A, that has_one model B, model A have a method called > save_nested_b that: > * context 'invalid B params' >  ** context 'no nested B exists' => do nothing >  ** context 'nested B exists' => remove it

Re: [rspec-users] [rails] mock controllers, different behaviour between ruby 1.8.7 and ruby 1.9.1

2010-03-15 Thread David Chelimsky
On Mon, Mar 15, 2010 at 3:48 AM, giorgian wrote: > Hi, > > I wanted to test something like this: > > # /lib/rest_verification.rb > module RestVerification >  def self.included(base) # :nodoc: >    base.extend(ClassMethods) >  end > >  module ClassMethods >    def verify_rest_actions >      verify

Re: [rspec-users] Strange validation errors

2010-03-15 Thread David Chelimsky
On Mon, Mar 15, 2010 at 6:54 AM, jollyroger wrote: > Hey guys, > > I'm having a serious rspec-problem at the moment: > > I keep getting strange, empty validation errors when I run the whole > spec-suite: > > # > 1) > ActiveRecord::Rec

[rspec-users] [rails] mock controllers, different behaviour between ruby 1.8.7 and ruby 1.9.1

2010-03-15 Thread giorgian
Hi, I wanted to test something like this: # /lib/rest_verification.rb module RestVerification def self.included(base) # :nodoc: base.extend(ClassMethods) end module ClassMethods def verify_rest_actions verify :method => :post, :only => [:create], :redirect_to => { :action =>

Re: [rspec-users] Insufficient database clean-up between specs

2010-03-15 Thread David Chelimsky
On Mon, Mar 15, 2010 at 7:24 AM, jollyroger wrote: > Hey guys, > > unfortunately I've got one more issue with rspec right now. > > It seems like rspec isnt properly cleaning up the database after each > spec. > > I have the following spec: > > ##

[rspec-users] Insufficient database clean-up between specs

2010-03-15 Thread jollyroger
Hey guys, unfortunately I've got one more issue with rspec right now. It seems like rspec isnt properly cleaning up the database after each spec. I have the following spec: ### describe ProfilesController do describe "GET 'index'

[rspec-users] Strange validation errors

2010-03-15 Thread jollyroger
Hey guys, I'm having a serious rspec-problem at the moment: I keep getting strange, empty validation errors when I run the whole spec-suite: # 1) ActiveRecord::RecordInvalid in 'LikesController DELETE destroy' should change like-cou