Skip to content

Commit 196d8e8

Browse files
committed
rubocop
1 parent d860854 commit 196d8e8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/completely/installer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ class << self
44
def from_io(program:, io: nil)
55
io ||= $stdin
66

7-
raise InstallError, "io must respond to #read" unless io.respond_to?(:read)
8-
raise InstallError, "io is closed" if io.respond_to?(:closed?) && io.closed?
7+
raise InstallError, 'io must respond to #read' unless io.respond_to?(:read)
8+
raise InstallError, 'io is closed' if io.respond_to?(:closed?) && io.closed?
99

1010
from_string program:, string: io.read
1111
end
@@ -23,7 +23,7 @@ def from_string(program:, string:)
2323
end
2424

2525
def create_tempfile
26-
tempfile = Tempfile.new ["completely-", '.bash']
26+
tempfile = Tempfile.new ['completely-', '.bash']
2727
tempfiles.push tempfile
2828
tempfile
2929
end

spec/completely/installer_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,20 @@
1414
end
1515

1616
describe '::from_io' do
17-
let(:io) { StringIO.new 'dummy data' }
1817
subject { described_class.from_io program:, io: }
1918

19+
let(:io) { StringIO.new 'dummy data' }
20+
2021
it 'reads the script from io and writes it to a temp file' do
2122
expect(File.read subject.script_path).to eq 'dummy data'
2223
end
2324
end
2425

2526
describe '::from_string' do
26-
let(:string) { 'dummy data' }
2727
subject { described_class.from_string program:, string: }
2828

29+
let(:string) { 'dummy data' }
30+
2931
it 'reads the script from io and writes it to a temp file' do
3032
expect(File.read subject.script_path).to eq 'dummy data'
3133
end

0 commit comments

Comments
 (0)