Sha256: 563969cfd78979ae008141dd2479af90be11848284459c1926a05561d42c1e89

Contents?: true

Size: 745 Bytes

Versions: 22

Compression:

Stored size: 745 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

22 entries across 20 versions & 4 rubygems

Version Path
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.8.0/spec/rspec/matchers/method_missing_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.8.0/spec/rspec/matchers/method_missing_spec.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.8.0/spec/rspec/matchers/method_missing_spec.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.8.0/spec/rspec/matchers/method_missing_spec.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.8.0 spec/rspec/matchers/method_missing_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.8.0.rc2 spec/rspec/matchers/method_missing_spec.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.8.0.rc1 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.7.0 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.7.0.rc1 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.6.0 spec/rspec/matchers/method_missing_spec.rb
rspec-expectations-2.6.0.rc6 spec/rspec/matchers/method_missing_spec.rb