Skip to content

Commit ff92d73

Browse files
committed
Add spec over Plot#unset
1 parent 4e023d6 commit ff92d73

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

spec/lib/ruby_gnuplot/plot_spec.rb

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,33 @@
8787
it_behaves_like 'quotes value when setting in a plot for', :cblabel
8888
it_behaves_like 'quotes value when setting in a plot for', :zlabel
8989

90-
describe '[]' do
90+
describe '#unset' do
91+
let(:expected_string) do
92+
[
93+
'set title "My Title"',
94+
'unset title',
95+
''
96+
].join("\n")
97+
end
98+
99+
before do
100+
plot.title 'My Title'
101+
end
102+
103+
# TODO: check specification
104+
xit 'changes value in current settings' do
105+
expect { plot.unset 'title' }
106+
.to change { plot['title'] }
107+
.from('My title').to(nil)
108+
end
109+
110+
it 'unsets key on output' do
111+
plot.unset 'title'
112+
expect(plot.to_gplot).to eq(expected_string)
113+
end
114+
end
115+
116+
describe '#[]' do
91117
context 'when value was never set' do
92118
it { expect(plot['key']).to be_nil }
93119
end

0 commit comments

Comments
 (0)