Skip to content

Commit 3f96d3c

Browse files
committed
Fix the way to pass keyword arguments
1 parent d678348 commit 3f96d3c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spec/histogram/array_spec.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
RSpec.describe Array, '#histogram' do
55
let(:ary) { [] }
66
let(:args) { [] }
7+
let(:kwargs) { {} }
78

8-
subject(:histogram) { ary.histogram(*args) }
9+
subject(:histogram) { ary.histogram(*args, **kwargs) }
910

1011
with_array [] do
1112
context 'default' do
@@ -18,7 +19,7 @@
1819
end
1920

2021
context 'closed: :right' do
21-
let(:args) { [{closed: :right}] }
22+
let(:kwargs) { {closed: :right} }
2223

2324
specify do
2425
expect(histogram.edge).to eq([0.0])
@@ -53,7 +54,7 @@
5354

5455
with_array [1, 2] do
5556
context 'closed: :left' do
56-
let(:args) { [{closed: :left}] }
57+
let(:kwargs) { {closed: :left} }
5758

5859
specify do
5960
expect(histogram.edge).to eq([1.0, 1.5, 2.0, 2.5])
@@ -75,7 +76,7 @@
7576
end
7677

7778
context 'closed: :right' do
78-
let(:args) { [{closed: :right}] }
79+
let(:kwargs) { {closed: :right} }
7980

8081
specify do
8182
expect(histogram.edge).to eq([0.0, 2.0, 4.0, 6.0, 8.0, 10.0])
@@ -121,7 +122,7 @@
121122
end
122123

123124
context "closed: :right" do
124-
let(:args) { [{closed: :right}] }
125+
let(:kwargs) { {closed: :right} }
125126

126127
specify do
127128
expect(histogram.edge).to eq([-4.0, -3.5, -3.0, -2.5, -2.0, -1.5,

0 commit comments

Comments
 (0)