Sha256: bea8635303a20530fccf2ab7affc5dd14f64a6cfd46272e8b853928c37833586

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

require 'rspec'
require_relative '../lib/enhanced_errors'

# INSTRUCTIONS:  Install rspec
# gem install rspec
# rspec examples/example_spec.rb

RSpec.describe 'Neo' do
  before(:each) do
    EnhancedErrors.enhance_exceptions!(override_messages: true)
  end

  describe 'sees through' do
    let(:the_matrix) { 'code rains, dramatically' }

    before(:each) do
      @spoon = 'there is no spoon'
    end

    it 'the matrix' do
      #activate memoized item
      the_matrix
      stop = 'bullets'
      raise 'No!'
    end
  end
end

# Note:
# The approach above is unlikely to work in large codebases where there are many
# exception-based specs that verify exception messages.
#
# Instead, take this (recommended) approach:
#
# RSpec.configure do |config|
#   config.before(:suite) do
#     RSpec::Core::Example.prepend(Enhanced::Integrations::RSpecErrorFailureMessage)
#   end
#
#   config.before(:example) do |_example|
#     EnhancedErrors.start_rspec_binding_capture
#   end
#
#   config.after(:example) do |example|
#     example.metadata[:expect_binding] = EnhancedErrors.stop_rspec_binding_capture
#   end
# end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
enhanced_errors-2.0.6 examples/example_spec.rb
enhanced_errors-2.0.5 examples/example_spec.rb
enhanced_errors-2.0.4 examples/example_spec.rb
enhanced_errors-2.0.3 examples/example_spec.rb
enhanced_errors-2.0.2 examples/example_spec.rb
enhanced_errors-2.0.1 examples/example_spec.rb
enhanced_errors-2.0.0 examples/example_spec.rb