Skip to content

Commit c6bbe70

Browse files
committed
Change the params string conversion tests to maintain Ruby compatibility
1 parent 7afdc27 commit c6bbe70

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/unit/params_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,17 @@
124124

125125
context "to_s/inspect" do
126126
it "returns string representation of internal parameters" do
127-
params = described_class.new({a: 1, b: 2, c: 3})
127+
parameters = {a: 1, b: 2, c: 3}
128+
params = described_class.new(parameters)
128129

129-
expect(params.to_s).to eq("{:a=>1, :b=>2, :c=>3}")
130+
expect(params.to_s).to eq(parameters.to_s)
130131
end
131132

132133
it "returns string representation of the class" do
133-
params = described_class.new({a: 1, b: 2, c: 3})
134+
parameters = {a: 1, b: 2, c: 3}
135+
params = described_class.new(parameters)
134136

135-
expect(params.inspect).to eq("#<TTY::Option::Params{:a=>1, :b=>2, :c=>3}>")
137+
expect(params.inspect).to eq("#<TTY::Option::Params#{parameters}>")
136138
end
137139
end
138140
end

0 commit comments

Comments
 (0)