Sha256: a4f3e929cebe48b4b1a80b7b16b84a7453307ef22b0e17fad802655daefb7547

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

module DevelopWithPassion
  module Fakes
    module RSpec
      describe ReceivedCriteria do
        context "when matching a call made without arguments" do
          it "should match if the call was made" do
            item = fake
            item.hello

            sut = ReceivedCriteria.new(item.received(:hello))

            sut.is_satified_by.should be_true
          end
        end
        context "when matching a call made with arguments" do
          let(:item){fake}
          before (:each) do
            item.hello("world")
            @sut = ReceivedCriteria.new(item.received(:hello))
          end
          context "and we care about the arguments it was called with" do
            it "should match if it received the correct call" do
              @sut.is_satified_by("world").should be_true
            end
            it "should not match if the arguments provided are not in the call history" do
              @sut.is_satified_by("yo").should be_false
            end
            
          end
          context "and we don't care about the arguments it was called with" do
            it "should match if it received a call to the method" do
              @sut.is_satified_by.should be_true
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
developwithpassion_fakes-rspec-0.0.4 spec/specs/received_criteria_spec.rb
developwithpassion_fakes-rspec-0.0.3 spec/specs/received_criteria_spec.rb
developwithpassion_fakes-rspec-0.0.2 spec/specs/received_criteria_spec.rb
developwithpassion_fakes-rspec-0.0.1 spec/specs/received_criteria_spec.rb