Skip to content

Commit 21fabe5

Browse files
committed
WIP add spec for plot args
1 parent 6decfe0 commit 21fabe5

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

spec/lib/ruby_gnuplot/data_set_spec.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
end
5353
end
5454

55-
context 'when setting attributes' do
55+
context 'when setting attributes in a block' do
5656
subject(:data_set) do
5757
described_class.new do |ds|
5858
ds.with = 'lines'
@@ -67,4 +67,23 @@
6767
end
6868
end
6969
end
70+
71+
describe '#plot_args' do
72+
context 'when setting attributes on initialize block' do
73+
subject(:data_set) do
74+
described_class.new do |ds|
75+
ds.with = 'lines'
76+
ds.using = '1:2'
77+
ds.data = data
78+
end
79+
end
80+
81+
let(:data) { [ [0, 1, 2], [1, 2, 5] ] }
82+
83+
it 'returns plot attributes' do
84+
expect(data_set.plot_args)
85+
.to eq("'-' using 1:2 with lines")
86+
end
87+
end
88+
end
7089
end

0 commit comments

Comments
 (0)