summaryrefslogtreecommitdiff
path: root/spec/hunk_spec.rb
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2021-12-23 10:44:44 -0500
committerAustin Ziegler <austin@zieglers.ca>2022-07-04 20:26:10 -0400
commitf85ec381137c6838600b16c353ff9dba3a05452c (patch)
tree7a2718961e97c56d4c70dc0a6ebe6b17aee005fc /spec/hunk_spec.rb
parentef23b66e9a495206f2bf1cd9ce0df50d363d26ef (diff)
downloaddiff-lcs-f85ec381137c6838600b16c353ff9dba3a05452c.tar.gz
standardrb --only Style/StringLiterals --fix
Diffstat (limited to 'spec/hunk_spec.rb')
-rw-r--r--spec/hunk_spec.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/hunk_spec.rb b/spec/hunk_spec.rb
index b3616bf..339f4ab 100644
--- a/spec/hunk_spec.rb
+++ b/spec/hunk_spec.rb
@@ -1,18 +1,18 @@
# frozen_string_literal: true
-require 'spec_helper'
+require "spec_helper"
if String.method_defined?(:encoding)
- require 'diff/lcs/hunk'
+ require "diff/lcs/hunk"
describe Diff::LCS::Hunk do
- let(:old_data) { ['Tu a un carté avec {count} itéms'.encode('UTF-16LE')] }
- let(:new_data) { ['Tu a un carte avec {count} items'.encode('UTF-16LE')] }
+ let(:old_data) { ["Tu a un carté avec {count} itéms".encode("UTF-16LE")] }
+ let(:new_data) { ["Tu a un carte avec {count} items".encode("UTF-16LE")] }
let(:pieces) { Diff::LCS.diff old_data, new_data }
let(:hunk) { Diff::LCS::Hunk.new(old_data, new_data, pieces[0], 3, 0) }
- it 'produces a unified diff from the two pieces' do
- expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
+ it "produces a unified diff from the two pieces" do
+ expected = <<-EXPECTED.gsub(/^\s+/, "").encode("UTF-16LE").chomp
@@ -1 +1 @@
-Tu a un carté avec {count} itéms
+Tu a un carte avec {count} items
@@ -21,8 +21,8 @@ if String.method_defined?(:encoding)
expect(hunk.diff(:unified)).to eq(expected)
end
- it 'produces a unified diff from the two pieces (last entry)' do
- expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
+ it "produces a unified diff from the two pieces (last entry)" do
+ expected = <<-EXPECTED.gsub(/^\s+/, "").encode("UTF-16LE").chomp
@@ -1 +1 @@
-Tu a un carté avec {count} itéms
+Tu a un carte avec {count} items
@@ -32,8 +32,8 @@ if String.method_defined?(:encoding)
expect(hunk.diff(:unified, true)).to eq(expected)
end
- it 'produces a context diff from the two pieces' do
- expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
+ it "produces a context diff from the two pieces" do
+ expected = <<-EXPECTED.gsub(/^\s+/, "").encode("UTF-16LE").chomp
***************
*** 1 ****
! Tu a un carté avec {count} itéms
@@ -44,8 +44,8 @@ if String.method_defined?(:encoding)
expect(hunk.diff(:context)).to eq(expected)
end
- it 'produces an old diff from the two pieces' do
- expected = <<-EXPECTED.gsub(/^ +/, '').encode('UTF-16LE').chomp
+ it "produces an old diff from the two pieces" do
+ expected = <<-EXPECTED.gsub(/^ +/, "").encode("UTF-16LE").chomp
1c1
< Tu a un carté avec {count} itéms
---
@@ -56,8 +56,8 @@ if String.method_defined?(:encoding)
expect(hunk.diff(:old)).to eq(expected)
end
- it 'produces a reverse ed diff from the two pieces' do
- expected = <<-EXPECTED.gsub(/^ +/, '').encode('UTF-16LE').chomp
+ it "produces a reverse ed diff from the two pieces" do
+ expected = <<-EXPECTED.gsub(/^ +/, "").encode("UTF-16LE").chomp
c1
Tu a un carte avec {count} items
.
@@ -67,11 +67,11 @@ if String.method_defined?(:encoding)
expect(hunk.diff(:reverse_ed)).to eq(expected)
end
- context 'with empty first data set' do
+ context "with empty first data set" do
let(:old_data) { [] }
- it 'produces a unified diff' do
- expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
+ it "produces a unified diff" do
+ expected = <<-EXPECTED.gsub(/^\s+/, "").encode("UTF-16LE").chomp
@@ -1 +1,2 @@
+Tu a un carte avec {count} items
EXPECTED