We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c72ea5 commit 2b577b1Copy full SHA for 2b577b1
spec/lib/ruby_gnuplot/plot_spec.rb
@@ -0,0 +1,32 @@
1
+describe Gnuplot::Plot do
2
+ subject(:plot) { described_class.new }
3
+
4
+ describe '#to_gplot' do
5
+ context 'when nothing has been set' do
6
+ it "returns an empty string" do
7
+ expect(plot.to_gplot).to eq('')
8
+ end
9
10
11
+ context 'when titles and labels have been set' do
12
+ let(:expected_string) do
13
+ [
14
+ 'set title "Array Plot Example"',
15
+ 'set ylabel "x"',
16
+ 'set xlabel "x^2"',
17
+ ''
18
+ ].join("\n")
19
20
21
+ before do
22
+ plot.title "Array Plot Example"
23
+ plot.ylabel "x"
24
+ plot.xlabel "x^2"
25
26
27
+ it "sets title and axis labels" do
28
+ expect(plot.to_gplot).to eq(expected_string)
29
30
31
32
+end
0 commit comments