Skip to content

Commit cbc84fc

Browse files
committed
Combine examples
1 parent 4b854b3 commit cbc84fc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

spec/matplotlib/pyplot_spec.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
module Matplotlib
55
::RSpec.describe Pyplot do
66
describe '.xkcd' do
7-
specify do
8-
expect { |b| Pyplot.xkcd(&b) }.to yield_control
9-
end
10-
117
specify do
128
saved_font_family = Matplotlib.rcParams['font.family']
139
saved_path_sketch = Matplotlib.rcParams['path.sketch']
14-
Pyplot.xkcd(scale: 42, length: 43, randomness: 44) do
15-
expect(Matplotlib.rcParams['font.family']).to include('xkcd')
16-
expect(Matplotlib.rcParams['path.sketch']).to eq(PyCall.tuple(42, 43, 44))
17-
end
10+
expect { |b|
11+
Pyplot.xkcd(scale: 42, length: 43, randomness: 44) do
12+
lambda(&b).call
13+
expect(Matplotlib.rcParams['font.family']).to include('xkcd')
14+
expect(Matplotlib.rcParams['path.sketch']).to eq(PyCall.tuple(42, 43, 44))
15+
end
16+
}.to yield_control
1817
expect(Matplotlib.rcParams['font.family']).to eq(saved_font_family)
1918
expect(Matplotlib.rcParams['path.sketch']).to eq(saved_path_sketch)
2019
end

0 commit comments

Comments
 (0)