Skip to content

Commit 0ba3073

Browse files
committed
Add spec for Plot#style
1 parent 91fca06 commit 0ba3073

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ AllCops:
77
RSpec/DescribeClass:
88
Exclude:
99
- 'spec/**/*_spec.rb'
10+
11+
Metrics/BlockLength:
12+
Exclude:
13+
- 'spec/**/*_spec.rb'

spec/lib/ruby_gnuplot/plot_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,23 @@
198198
end
199199
end
200200
end
201+
202+
describe '#style' do
203+
subject(:plot) do
204+
described_class.new do |p|
205+
p.title 'My title'
206+
p.style do |style|
207+
style.ls = 1
208+
end
209+
end
210+
end
211+
212+
let(:expected_output) do
213+
/^set title "My title"\nset style line \d+ ls 1\n$/
214+
end
215+
216+
it 'adds style to gplot output' do
217+
expect(plot.to_gplot).to match(expected_output)
218+
end
219+
end
201220
end

0 commit comments

Comments
 (0)