Sha256: 8e21d7b0482b56645b20c7fe0478e6a4f6c76a81fb3900f8e8b7484c3e677278

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

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

Spec::Matchers.create :have_public_instance_method do |method|
  match do |klass|
    klass.public_instance_methods.include?(method)
  end
end

module Spec
  module Matchers
    describe Spec::Matchers do
      (Spec::Matchers.constants.sort).each do |c|
        if (Class === (klass = Spec::Matchers.const_get(c)))
          describe klass do
            if klass.public_instance_methods.include?('failure_message_for_should')
              describe "called with should" do
                subject { klass }
                it { should have_public_instance_method('failure_message_for_should')}
                it { should have_public_instance_method('failure_message')}
              end
            end
            if klass.public_instance_methods.include?('failure_message_for_should_not')
              describe "called with should not" do
                subject { klass }
                it { should have_public_instance_method('failure_message_for_should_not')}
                it { should have_public_instance_method('negative_failure_message')}
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-1.2.0 spec/spec/matchers/compatibility_spec.rb
rspec-1.2.1 spec/spec/matchers/compatibility_spec.rb
rspec-1.2.2 spec/spec/matchers/compatibility_spec.rb