summaryrefslogtreecommitdiff
path: root/spec/ldiff_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ldiff_spec.rb')
-rw-r--r--spec/ldiff_spec.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/spec/ldiff_spec.rb b/spec/ldiff_spec.rb
index a2468f8..cf89ada 100644
--- a/spec/ldiff_spec.rb
+++ b/spec/ldiff_spec.rb
@@ -1,29 +1,31 @@
# frozen_string_literal: true
-require 'spec_helper'
+require "spec_helper"
-RSpec.describe 'bin/ldiff' do
+RSpec.describe "bin/ldiff" do
include CaptureSubprocessIO
+ # standard:disable Style/HashSyntax
fixtures = [
- { :name => 'output.diff', :left => 'aX', :right => 'bXaX' },
- { :name => 'output.diff.chef', :left => 'old-chef', :right => 'new-chef' },
- { :name => 'output.diff.chef2', :left => 'old-chef2', :right => 'new-chef2' }
- ].product([nil, '-e', '-f', '-c', '-u']).map { |(fixture, flag)|
+ {:name => "output.diff", :left => "aX", :right => "bXaX"},
+ {:name => "output.diff.chef", :left => "old-chef", :right => "new-chef"},
+ {:name => "output.diff.chef2", :left => "old-chef2", :right => "new-chef2"}
+ ].product([nil, "-e", "-f", "-c", "-u"]).map { |(fixture, flag)|
fixture = fixture.dup
fixture[:flag] = flag
fixture
}
+ # standard:enable Style/HashSyntax
def self.test_ldiff(fixture)
desc = [
fixture[:flag],
"spec/fixtures/#{fixture[:left]}",
"spec/fixtures/#{fixture[:right]}",
- '#',
- '=>',
+ "#",
+ "=>",
"spec/fixtures/ldiff/#{fixture[:name]}#{fixture[:flag]}"
- ].join(' ')
+ ].join(" ")
it desc do
expect(run_ldiff(fixture)).to eq(read_fixture(fixture))
@@ -45,7 +47,7 @@ RSpec.describe 'bin/ldiff' do
def clean_data(data, flag)
data =
case flag
- when '-c', '-u'
+ when "-c", "-u"
clean_output_timestamp(data)
else
data
@@ -80,7 +82,7 @@ RSpec.describe 'bin/ldiff' do
system("ruby -Ilib bin/ldiff #{flag} spec/fixtures/#{left} spec/fixtures/#{right}")
end
- expect(stderr).to be_empty if RUBY_VERSION >= '1.9'
+ expect(stderr).to be_empty if RUBY_VERSION >= "1.9"
expect(stdout).not_to be_empty
clean_data(stdout, flag)
end