Sha256: 9f596f81c2245ca288d5304094a786634d207ae7205ed5d6ea279a870e120299

Contents?: true

Size: 1.06 KB

Versions: 232

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

RSpec::Matchers.define :have_public_instance_method do |method|
  match do |klass|
    klass.public_instance_methods.any? {|m| [method, method.to_sym].include?(m)}
  end
end

(RSpec::Matchers.constants.sort).each do |c|
  if (Class === (klass = RSpec::Matchers.const_get(c)))
    describe klass do
      if klass.public_instance_methods.any? {|m| ['failure_message_for_should',:failure_message_for_should].include?(m)}
        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.any? {|m| ['failure_message_for_should_not',:failure_message_for_should_not].include?(m)}
        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

Version data entries

232 entries across 131 versions & 13 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/compatibility_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/compatibility_spec.rb