Sha256: bbdcb58d4923b5eb336407b05bf10826e282b5f8bda12df07a33ec476bb1cf21

Contents?: true

Size: 1.11 KB

Versions: 23

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

module Fakes
  describe ArgMatchFactory do
    context "when creating an argument matcher" do
      context "and none of the arguments are matchers themselves" do
        before (:each) do
          @result = ArgMatchFactory.create_arg_matcher_using([2,3,4])
        end
        
        it "should create a combined matcher that is composed of regular matchers" do
          @result.all_matchers.count.should == 3
          @result.all_matchers.each do|matcher|
            matcher.class.should == RegularArgMatcher
          end
        end
      end
      context "and the arguments are matchers themselves" do
        let(:matcher){Object.new}
        before (:each) do
          matcher.stub(:respond_to?).with(:matches?).and_return(true)
        end
        
        before (:each) do
          @result = ArgMatchFactory.create_arg_matcher_using([matcher])
        end
        
        it "should create a combined matcher that only using the matchers provided" do
          @result.all_matchers.count.should == 1
          @result.all_matchers[0].should == matcher
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
fakes-1.1.4 spec/specs/arg_match_factory_spec.rb
fakes-1.1.3 spec/specs/arg_match_factory_spec.rb
fakes-1.1.2 spec/specs/arg_match_factory_spec.rb
fakes-1.0.31 spec/specs/arg_match_factory_spec.rb
fakes-1.0.30 spec/specs/arg_match_factory_spec.rb
fakes-1.0.25 spec/specs/arg_match_factory_spec.rb
fakes-1.1.1 spec/specs/arg_match_factory_spec.rb
fakes-1.0.24 spec/specs/arg_match_factory_spec.rb
fakes-1.0.22 spec/specs/arg_match_factory_spec.rb
fakes-1.1.0 spec/specs/arg_match_factory_spec.rb
fakes-1.0.9 spec/specs/arg_match_factory_spec.rb
fakes-1.0.8 spec/specs/arg_match_factory_spec.rb
fakes-1.0.7 spec/specs/arg_match_factory_spec.rb
fakes-1.0.6 spec/specs/arg_match_factory_spec.rb
fakes-1.0.5 spec/specs/arg_match_factory_spec.rb
fakes-1.0.2 spec/specs/arg_match_factory_spec.rb
fakes-1.0.1 spec/specs/arg_match_factory_spec.rb
fakes-1.0.0 spec/specs/arg_match_factory_spec.rb
fakes-0.4.1 spec/specs/arg_match_factory_spec.rb
fakes-0.4.0 spec/specs/arg_match_factory_spec.rb