forked from SciRuby/daru-view
/
view_spec.rb
47 lines (40 loc) · 1.49 KB
/
view_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
describe Daru::View, "Daru::View class basic methods" do
context "#plotting_library" do
context 'Set plotting library to googlecharts' do
before { Daru::View.plotting_library = :googlecharts}
it { expect(Daru::View.plotting_library).to eq(:googlecharts) }
end
context 'Set plotting library to highcharts' do
before { Daru::View.plotting_library = :highcharts}
it { expect(Daru::View.plotting_library).to eq(:highcharts) }
end
context 'Set plotting library to nyaplot' do
before { Daru::View.plotting_library = :nyaplot}
it { expect(Daru::View.plotting_library).to eq(:nyaplot) }
end
context 'Set plotting library to xyz, which is unsupported' do
it "should raise ArgumentError" do
expect{
Daru::View.plotting_library = :xyz_library
}.to raise_error(ArgumentError)
end
end
end
context "#table_library" do
context 'Set table library to googlecharts' do
before { Daru::View.table_library = :googlecharts}
it { expect(Daru::View.table_library).to eq(:googlecharts) }
end
context 'Set table library to datatables' do
before { Daru::View.table_library = :datatables}
it { expect(Daru::View.table_library).to eq(:datatables) }
end
context 'Set table library to xyz, which is unsupported' do
it "should raise ArgumentError" do
expect{
Daru::View.table_library = :xyz_library
}.to raise_error(ArgumentError)
end
end
end
end