Sha256: 5b73d08be5137678d228f01f62be625545d51cd9aa2ec7b5bfea7298e86df2ef

Contents?: true

Size: 948 Bytes

Versions: 10

Compression:

Stored size: 948 Bytes

Contents

require 'spec_helper'
require 'rspec/core/formatters/snippet_extractor'

module RSpec
  module Core
    module Formatters
      RSpec.describe SnippetExtractor do
        it "falls back on a default message when it doesn't understand a line" do
          expect(RSpec::Core::Formatters::SnippetExtractor.new.snippet_for("blech")).to eq(["# Couldn't get snippet for blech", 1])
        end

        it "falls back on a default message when it doesn't find the file" do
         expect(RSpec::Core::Formatters::SnippetExtractor.new.lines_around("blech", 8)).to eq("# Couldn't get snippet for blech")
        end

        it "falls back on a default message when it gets a security error" do
          message = nil
          safely do
            message = RSpec::Core::Formatters::SnippetExtractor.new.lines_around("blech", 8)
          end
          expect(message).to eq("# Couldn't get snippet for blech")
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
opal-rspec-0.6.2 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.6.1 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.6.0 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.6.0.beta1 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-connect-rspec-0.5.0 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.5.0 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.5.0.beta3 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.5.0.beta2 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
opal-rspec-0.5.0.beta1 rspec-core/spec/rspec/core/formatters/snippet_extractor_spec.rb
rspec-core-3.0.0.beta2 spec/rspec/core/formatters/snippet_extractor_spec.rb