Sha256: aa767dc0807adfd0dc11af1d9c58c9ce7f414e8dc3bdb5669fe8a94a84d89187

Contents?: true

Size: 823 Bytes

Versions: 43

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

shared_examples_for "a well-behaved method_missing hook" do
  include TestUnitIntegrationSupport

  it "raises a NoMethodError (and not SystemStackError) for an undefined method" do
    with_test_unit_loaded do
      expect { subject.some_undefined_method }.to raise_error(NoMethodError)
    end
  end
end

describe "RSpec::Matchers method_missing hook" do
  subject { self }

  it_behaves_like "a well-behaved method_missing hook"

  context 'when invoked in a Test::Unit::TestCase' do
    subject { Test::Unit::TestCase.allocate }
    it_behaves_like "a well-behaved method_missing hook"
  end

  context 'when invoked in a MiniTest::Unit::TestCase', :if => defined?(MiniTest) do
    subject { MiniTest::Unit::TestCase.allocate }
    it_behaves_like "a well-behaved method_missing hook"
  end
end

Version data entries

43 entries across 43 versions & 12 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-expectations-2.14.5/spec/rspec/matchers/method_missing_spec.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-expectations-2.13.0/spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.99.2 spec/rspec/matchers/method_missing_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-expectations-2.14.4/spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.99.1 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.99.0 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.99.0.rc1 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.99.0.beta2 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.14.5 spec/rspec/matchers/method_missing_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/method_missing_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/method_missing_spec.rb
dxruby_rp5-0.0.3 spec/vendor/rspec-expectations-2.14.4/spec/rspec/matchers/method_missing_spec.rb