Sha256: e20ea6483d6e6356bf163a6e5c83572e1ebbcf2a18fdf8676ef83bacec89b297

Contents?: true

Size: 940 Bytes

Versions: 6

Compression:

Stored size: 940 Bytes

Contents

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

module Spec
  module Matchers
    module DSL
      describe "#create" do
        it "is deprecated" do
          Spec.should_receive(:deprecate)
          mod = Module.new
          mod.extend Spec::Matchers::DSL
          mod.create(:foo)
        end
      end
      
      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 Spec::Matchers::DSL
          mod.define(: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

6 entries across 6 versions & 1 rubygems

Version Path
rspec-1.2.7 spec/spec/matchers/dsl_spec.rb
rspec-1.2.8 spec/spec/matchers/dsl_spec.rb
rspec-1.2.3 spec/spec/matchers/dsl_spec.rb
rspec-1.2.4 spec/spec/matchers/dsl_spec.rb
rspec-1.2.5 spec/spec/matchers/dsl_spec.rb
rspec-1.2.6 spec/spec/matchers/dsl_spec.rb