Sha256: 5c2dd388051c3424f8d662ad38b57c7fbfc4c12938c400c632177c7e6ec417e6

Contents?: true

Size: 1.06 KB

Versions: 32

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

Spec::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

(Spec::Matchers.constants.sort).each do |c|
  if (Class === (klass = Spec::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

32 entries across 32 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 spec/spec/matchers/compatibility_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/spec/matchers/compatibility_spec.rb
rspec-1.3.2 spec/spec/matchers/compatibility_spec.rb
rspec-1.3.1 spec/spec/matchers/compatibility_spec.rb
rspec-1.3.1.rc spec/spec/matchers/compatibility_spec.rb
rspec-1.3.0 spec/spec/matchers/compatibility_spec.rb
hubbub-0.0.11 lib/vendor/plugins/rspec/spec/spec/matchers/compatibility_spec.rb
hubbub-0.0.10 lib/vendor/plugins/rspec/spec/spec/matchers/compatibility_spec.rb
hubbub-0.0.9 lib/vendor/plugins/rspec/spec/spec/matchers/compatibility_spec.rb
hubbub-0.0.8 lib/vendor/plugins/rspec/spec/spec/matchers/compatibility_spec.rb
hubbub-0.0.6 lib/vendor/plugins/rspec/spec/spec/matchers/compatibility_spec.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/spec/spec/matchers/compatibility_spec.rb
media-path-0.1.2 vendor/rspec/spec/spec/matchers/compatibility_spec.rb
simple-templater-0.0.1.3 vendor/rspec/spec/spec/matchers/compatibility_spec.rb
pupu-0.0.2.pre vendor/rspec/spec/spec/matchers/compatibility_spec.rb
media-path-0.1.1.pre vendor/rspec/spec/spec/matchers/compatibility_spec.rb
simple-templater-0.0.1.2 vendor/rspec/spec/spec/matchers/compatibility_spec.rb
media-path-0.1.1 vendor/rspec/spec/spec/matchers/compatibility_spec.rb
simple-templater-0.0.1.1 vendor/rspec/spec/spec/matchers/compatibility_spec.rb
pupu-0.0.2 vendor/rspec/spec/spec/matchers/compatibility_spec.rb