-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from SciRuby/test_improve
Improving the coverage report for view.rb file
- Loading branch information
Showing
4 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |