Sha256: a0bebb9b2d462317b8bec25f22c9a893a2d55788121949b529f90d0f819d8a04

Contents?: true

Size: 684 Bytes

Versions: 11

Compression:

Stored size: 684 Bytes

Contents

require 'spec_helper'

module Rspec
  module Matchers
    module DSL
      describe "#define" 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 Rspec::Matchers::DSL
          mod.define(:foo)
    
          obj = Object.new
          obj.extend mod
    
          Rspec::Matchers::Matcher.should_receive(:new).with(:foo, 3)
    
          obj.foo(3)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.beta.3 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.beta.2 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.beta.1 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a10 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a9 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a8 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a7 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a6 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a5 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a4 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.0.0.a3 spec/rspec/matchers/dsl_spec.rb