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
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-expectations-2.13.0/spec/rspec/matchers/method_missing_spec.rb
vagrant-actionio-0.0.9 vendor/bundle/gems/rspec-expectations-2.13.0/spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.13.0 spec/rspec/matchers/method_missing_spec.rb