Sha256: 245c38fd9b6de33ef81071c59c1eeffaab7a18cfe70d9540a35f0b2736ecf7b4

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

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

module Spec
  module DSL
    module Matchers
      describe "#create" do
        it "creates a method that initializes a new matcher with the submitted name and expected arg" do
          # FIXME - this expects new to be called, but we need something
          # more robust - that expects new to be called with a specific
          # block (lambda, proc, whatever)
          mod = Module.new
          mod.extend Spec::DSL::Matchers
          mod.create(:foo)
    
          obj = Object.new
          obj.extend mod
    
          Spec::Matchers::Matcher.should_receive(:new).with(:foo, 3)
    
          obj.foo(3)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dchelimsky-rspec-1.1.99.13 spec/spec/dsl/matchers_spec.rb
rspec-1.2.0 spec/spec/dsl/matchers_spec.rb