Sha256: 17776dc6beddc6238c4045425d5d6de4ff204dd3972e31c2cc17d7910b99c258

Contents?: true

Size: 996 Bytes

Versions: 11

Compression:

Stored size: 996 Bytes

Contents

require 'spec_helper'

module Fakes
  describe IgnoreSet do
    let(:sut){IgnoreSet.new}

    context "when created" do
      it "should initialize required members" do
        sut.times_called.should == 0
      end
    end

    context "when matching an argument set" do
      it "should match any argument set" do
        sut.matches?([1,2,3,4]).should be_true
        sut.matches?([3,"hello",4,5]).should be_true
      end
    end

    context "when capturing a set of arguments" do
      before (:each) do
        sut.capture_args(1)
        sut.capture_args(2)
      end
      it "should store a list for each set of arguments" do
        sut.arg_sets.count.should == 2
      end
    end

    context "when determining if it was called with a set of arguments" do
      before (:each) do
        sut.capture_args(1)
        sut.capture_args(2)
      end
      it "should match if any of its argument sets match" do
        sut.was_called_with?(2).should be_true
      end
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fakes-0.2.3 spec/specs/ignore_set_spec.rb
fakes-0.2.2 spec/specs/ignore_set_spec.rb
fakes-0.2.1 spec/specs/ignore_set_spec.rb
fakes-0.2.0 spec/specs/ignore_set_spec.rb
fakes-0.1.9 spec/specs/ignore_set_spec.rb
fakes-0.1.7 spec/specs/ignore_set_spec.rb
fakes-0.1.6 spec/specs/ignore_set_spec.rb
fakes-0.1.5 spec/specs/ignore_set_spec.rb
fakes-0.1.4 spec/specs/ignore_set_spec.rb
fakes-0.1.3 spec/specs/ignore_set_spec.rb
fakes-0.1.2 spec/specs/ignore_set_spec.rb