Sha256: 78c0639fc7977ba73f5cf1b2f5e00b2684a5abf768e3a5922939720fb063745f

Contents?: true

Size: 805 Bytes

Versions: 2056

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true

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

2,056 entries across 2,055 versions & 17 rubygems

Version Path
cybrid_api_id_ruby-0.123.179 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.179 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.177 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.177 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.176 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.176 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.175 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.175 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.174 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.174 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.173 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.173 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
ory-client-1.16.3 vendor/bundle/ruby/3.1.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.172 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.172 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.171 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.171 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_id_ruby-0.123.170 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.170 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb
cybrid_api_organization_ruby-0.123.163 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/spec/diff_helpers.rb