Sha256: 5d70fd2cc935b3506f439e18d4c3e311f7921b7c0cb26045e1a915a64fae44ad

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

context "should respond_to(:sym)" do
  
  specify "should pass if target responds to :sym" do
    Object.new.should respond_to(:methods)
  end
  
  specify "should fail target does not respond to :sym" do
    lambda {
      Object.new.should respond_to(:some_method)
    }.should fail_with("expected target to respond to :some_method")
  end
  
end

context "should_not respond_to(:sym)" do
  
  specify "should pass if target does not respond to :sym" do
    Object.new.should_not respond_to(:some_method)
  end
  
  specify "should fail target responds to :sym" do
    lambda {
      Object.new.should_not respond_to(:methods)
    }.should fail_with("expected target not to respond to :methods")
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec/matchers/respond_to_spec.rb
rspec-0.8.0 spec/spec/matchers/respond_to_spec.rb
rspec-0.8.1 spec/spec/matchers/respond_to_spec.rb
rspec-0.8.2 spec/spec/matchers/respond_to_spec.rb