Sha256: d872c8fce3356cbf092571a67bf7afd5bf23312bd438d48a4b70b7e7e41998e6

Contents?: true

Size: 565 Bytes

Versions: 59

Compression:

Stored size: 565 Bytes

Contents

module RSpec
  module Matchers
    module DSL
      # Defines a custom matcher.
      # @see RSpec::Matchers
      def define(name, &declarations)
        matcher = RSpec::Matchers::DSL::Matcher.new(name, &declarations)
        define_method name do |*expected|
          $matcher_execution_context = self
          matcher.for_expected(*expected)
        end
      end

      alias_method :matcher, :define

      if RSpec.respond_to?(:configure)
        RSpec.configure {|c| c.extend self}
      end
    end
  end
end

RSpec::Matchers.extend RSpec::Matchers::DSL

Version data entries

59 entries across 59 versions & 5 rubygems

Version Path
classiccms-0.3.4 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.3.3 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.3.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.3.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.3.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classiccms-0.2.4.pre vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classicCMS-0.2.3 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classicCMS-0.2.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classicCMS-0.2.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classicCMS-0.2.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
classicCMS-0.1.2 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/dsl.rb
rspec-expectations-2.9.0 lib/rspec/matchers/dsl.rb
rspec-expectations-2.9.0.rc2 lib/rspec/matchers/dsl.rb