Sha256: 88bd1a20fc17debf963a00a0a130ba39fb62a4261a0a916add5af09e20c88c84

Contents?: true

Size: 774 Bytes

Versions: 4927

Compression:

Stored size: 774 Bytes

Contents

require 'diff/lcs'

module RSpec
  module Support
    module Spec
      module DiffHelpers
        # In the updated version of diff-lcs several diff headers change format slightly
        # compensate for this and change minimum version in RSpec 4
        if ::Diff::LCS::VERSION.to_f < 1.4
          def one_line_header(line_number=2)
            "-1,#{line_number} +1,#{line_number}"
          end
        else
          def one_line_header(_=2)
            "-1 +1"
          end
        end

        if Diff::LCS::VERSION.to_f < 1.4 || Diff::LCS::VERSION >= "1.4.4"
          def removing_two_line_header
            "-1,3 +1"
          end
        else
          def removing_two_line_header
            "-1,3 +1,5"
          end
        end
      end
    end
  end
end

Version data entries

4,927 entries across 4,914 versions & 45 rubygems

Version Path
cybrid_api_organization_ruby-0.113.118 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_bank_ruby-0.113.118 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_bank_ruby-0.113.117 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.113.117 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.113.117 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_bank_ruby-0.113.116 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.113.116 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.113.116 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_bank_ruby-0.113.115 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.113.115 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.113.115 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_bank_ruby-0.113.114 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.113.114 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.113.114 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
moneykit-0.1.5 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.113.111 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.113.110 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.113.110 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_bank_ruby-0.113.109 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.113.109 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/spec/diff_helpers.rb