Sha256: f14cd9d71572483e921f1ad0719daa0d72d60581baf97b1ff8a166c5eefe9663

Contents?: true

Size: 803 Bytes

Versions: 5

Compression:

Stored size: 803 Bytes

Contents

module RSpec
  module Core
    module Formatters
      class ExceptionPresenter
        def indent_lines(lines, failure_number)
          alignment_basis = ' ' * @indentation
          alignment_basis +=  "#{failure_number}) " if failure_number
          indentation = ' ' * alignment_basis.length

          lines.each_with_index.map do |line, index|
            if index == 0
              "#{alignment_basis}#{line}"
            elsif line.empty?
              line
            else
              "#{indentation}#{line}"
            end
          end
        end

        def fully_formatted(failure_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes)
          lines = fully_formatted_lines(failure_number, colorizer)
          lines.join("\n") + "\n"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-rspec-1.1.0.alpha3 lib-opal/opal/rspec/fixes/rspec/core/formatters/exception_presenter.rb
opal-rspec-1.1.0.alpha2 lib-opal/opal/rspec/fixes/rspec/core/formatters/exception_presenter.rb
opal-rspec-1.1.0.alpha1 lib-opal/opal/rspec/fixes/rspec/core/formatters/exception_presenter.rb
opal-rspec-1.0.0 lib-opal/opal/rspec/fixes/rspec/core/formatters/exception_presenter.rb
opal-rspec-1.0.0.alpha1 lib-opal/opal/rspec/fixes/rspec/core/formatters/exception_presenter.rb