Sha256: 1411314527e369c1b7b5b43916b652dc95d05185870e61f4f03de8a7ab6dfc22

Contents?: true

Size: 746 Bytes

Versions: 185

Compression:

Stored size: 746 Bytes

Contents

require 'spec_helper'

shared_examples_for "a well-behaved method_missing hook" do
  it "raises a NoMethodError (and not SystemStackError) for an undefined method" do
    expect { subject.some_undefined_method }.to raise_error(NoMethodError)
  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

185 entries across 87 versions & 14 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/method_missing_spec.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/spec/rspec/matchers/method_missing_spec.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.10.0/spec/rspec/matchers/method_missing_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.1/spec/rspec/matchers/method_missing_spec.rb