Sha256: 948dd75be3e8e05500d9b99301441d9218c0e12c9859b9a95e048c1ac4b50c13

Contents?: true

Size: 1.48 KB

Versions: 210

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

module RSpec::Matchers
  def __method_with_super
    super
  end

  module ModThatIncludesMatchers
    include RSpec::Matchers
  end

  RSpec.configure do |c|
    c.include RSpec::Matchers, :include_rspec_matchers => true
    c.include ModThatIncludesMatchers, :include_mod_that_includes_rspec_matchers => true
  end

  describe self do
    shared_examples_for "a normal module with a method that supers" do
      it "raises the expected error (and not SystemStackError)" do
        expect { __method_with_super }.to raise_error(NoMethodError) # there is no __method_with_super in an ancestor
      end
    end

    it_behaves_like "a normal module with a method that supers"

    context "when RSpec::Matchers has been included in an example group" do
      include RSpec::Matchers
      it_behaves_like "a normal module with a method that supers"
    end

    context "when a module that includes RSpec::Matchers has been included in an example group" do
      include RSpec::Matchers::ModThatIncludesMatchers
      it_behaves_like "a normal module with a method that supers"
    end

    context "when RSpec::Matchers is included via configuration", :include_rspec_matchers => true do
      it_behaves_like "a normal module with a method that supers"
    end

    context "when RSpec::Matchers is included in a module that is included via configuration", :include_mod_that_includes_rspec_matchers => true do
      it_behaves_like "a normal module with a method that supers"
    end
  end
end

Version data entries

210 entries across 155 versions & 26 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-core-2.10.0/spec/rspec/core/rspec_matchers_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-core-2.9.0/spec/rspec/core/rspec_matchers_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-core-2.9.0/spec/rspec/core/rspec_matchers_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-core-2.10.0/spec/rspec/core/rspec_matchers_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-core-2.9.0/spec/rspec/core/rspec_matchers_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-core-2.10.0/spec/rspec/core/rspec_matchers_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-core-2.14.8/spec/rspec/core/rspec_matchers_spec.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-core-2.13.0/spec/rspec/core/rspec_matchers_spec.rb
rspec-core-2.99.2 spec/rspec/core/rspec_matchers_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-core-2.14.7/spec/rspec/core/rspec_matchers_spec.rb
rspec-core-2.99.1 spec/rspec/core/rspec_matchers_spec.rb
rspec-core-2.99.0 spec/rspec/core/rspec_matchers_spec.rb