Hi there,

How does one spec an invocation of a Ruby keyword, such as super in this
case?

class User < ActiveResource::Base
  # faking the ActiveRecord before/after_save observers
  def save
    super
    UserMailer.deliver_activation(self) if recently_activated?
  end
end

Does the solution look anything like the following?

describe User do
  describe '#save' do
    it "should call save on the parent class" do
      # something.should_receive(:something)
      @user.save
    end
  end
end

Any thoughts?

Thanks much,
Matt

-- 
View this message in context: 
http://www.nabble.com/spec%27ing-calls-to-super-%28or-other-Ruby-keywords%29-tp17027929p17027929.html
Sent from the rspec-users mailing list archive at Nabble.com.

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to