Skip to content

Commit

Permalink
Merge pull request #896 from benedikt/remove-ostruct
Browse files Browse the repository at this point in the history
Remove usage of OpenStruct
  • Loading branch information
jnunemaker authored Nov 11, 2024
2 parents 9ac4502 + 15301bf commit dfd99fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/flipper/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
let(:stderr) { StringIO.new }
let(:cli) { Flipper::CLI.new(stdout: stdout, stderr: stderr) }

Result = Struct.new(:status, :stdout, :stderr, keyword_init: true)

before do
# Prentend stdout/stderr a TTY to test colorization
allow(stdout).to receive(:tty?).and_return(true)
allow(stderr).to receive(:tty?).and_return(true)
end

# Infer the command from the description
subject(:argv) do
let(:argv) do
descriptions = self.class.parent_groups.map {|g| g.metadata[:description_args] }.reverse.flatten.drop(1)
descriptions.map { |arg| Shellwords.split(arg) }.flatten
end
Expand All @@ -26,7 +28,7 @@
status = e.status
end

OpenStruct.new(status: status, stdout: stdout.string, stderr: stderr.string)
Result.new(status: status, stdout: stdout.string, stderr: stderr.string)
end

before do
Expand Down

0 comments on commit dfd99fc

Please sign in to comment.