Sha256: 9e58b784302f3d34763025ded007ec0916d9e8f412ea8c74ea0aaf193ebda0d2

Contents?: true

Size: 930 Bytes

Versions: 5

Compression:

Stored size: 930 Bytes

Contents

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

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

        it "falls back on a default message when it doesn't find the file" do
         RSpec::Core::Formatters::SnippetExtractor.new.lines_around("blech", 8).should 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
          message.should eq("# Couldn't get snippet for blech")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
remq-0.0.4 vendor/bundle/gems/rspec-core-2.12.2/spec/rspec/core/formatters/snippet_extractor_spec.rb
remq-0.0.3 vendor/bundle/gems/rspec-core-2.12.2/spec/rspec/core/formatters/snippet_extractor_spec.rb
rspec-core-2.12.2 spec/rspec/core/formatters/snippet_extractor_spec.rb
rspec-core-2.12.1 spec/rspec/core/formatters/snippet_extractor_spec.rb
rspec-core-2.12.0 spec/rspec/core/formatters/snippet_extractor_spec.rb