diff options
author | Austin Ziegler <austin@zieglers.ca> | 2022-07-05 15:43:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 15:43:30 -0400 |
commit | cab33a91e2894558b962b4b2236a213c6d63c54e (patch) | |
tree | fc14bc4c8a44e20026e1252a8cd435907d412ee1 /spec/ldiff_spec.rb | |
parent | 3062997fbbe19cb6099a65a5dbcd0aba7b9b17c7 (diff) | |
parent | 0270cb87e09dd444ad6822a777bb7999fd6f6e85 (diff) | |
download | diff-lcs-main.tar.gz |
Switch to standardrb formatting
Diffstat (limited to 'spec/ldiff_spec.rb')
-rw-r--r-- | spec/ldiff_spec.rb | 24 |
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 |