Sha256: f9124b9e1c7d65020607e6b68c11f83f1a584febc5c6cac50eb649275c05da7b

Contents?: true

Size: 715 Bytes

Versions: 57

Compression:

Stored size: 715 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) { stub('matcher').as_null_object }

          obj.foo(3)
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 6 rubygems

Version Path
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.8.0.rc1 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.7.0 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.7.0.rc1 spec/rspec/matchers/dsl_spec.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/spec/rspec/matchers/dsl_spec.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.6.0 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.6.0.rc6 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.6.0.rc4 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.6.0.rc2 spec/rspec/matchers/dsl_spec.rb
rspec-expectations-2.5.0 spec/rspec/matchers/dsl_spec.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/spec/rspec/matchers/dsl_spec.rb