Sha256: 35c282287bc2cdcc9460bbe120da14461cbeef51ed0b17b0fadd3a59c0b5164c

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

RSpec.shared_context "with #should enabled", :uses_should do
  orig_syntax = nil

  before(:all) do
    orig_syntax = RSpec::Matchers.configuration.syntax
    RSpec::Matchers.configuration.syntax = [:expect, :should]
  end

  after(:context) do
    RSpec::Matchers.configuration.syntax = orig_syntax
  end
end

RSpec.shared_context "with the default expectation syntax" do
  orig_syntax = nil

  before(:context) do
    orig_syntax = RSpec::Matchers.configuration.syntax
    RSpec::Matchers.configuration.reset_syntaxes_to_default
  end

  after(:context) do
    RSpec::Matchers.configuration.syntax = orig_syntax
  end

end

RSpec.shared_context "with #should exclusively enabled", :uses_only_should do
  orig_syntax = nil

  before(:context) do
    orig_syntax = RSpec::Matchers.configuration.syntax
    RSpec::Matchers.configuration.syntax = :should
  end

  after(:context) do
    RSpec::Matchers.configuration.syntax = orig_syntax
  end
end

RSpec.shared_context "isolate include_chain_clauses_in_custom_matcher_descriptions" do
  around do |ex|
    orig = RSpec::Expectations.configuration.include_chain_clauses_in_custom_matcher_descriptions?
    ex.run
    RSpec::Expectations.configuration.include_chain_clauses_in_custom_matcher_descriptions = orig
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
opal-rspec-0.6.2 spec/rspec/expectations/shared_examples.rb
opal-rspec-0.6.1 spec/rspec/expectations/shared_examples.rb
opal-rspec-0.6.0 spec/rspec/expectations/shared_examples.rb
opal-rspec-0.6.0.beta1 spec/rspec/expectations/shared_examples.rb
opal-connect-rspec-0.5.0 spec/rspec/expectations/shared_examples.rb
opal-rspec-0.5.0 spec/rspec/expectations/shared_examples.rb
opal-rspec-0.5.0.beta3 spec/rspec/expectations/shared_examples.rb