Skip to content

Commit

Permalink
Adds spec for sheet_for
Browse files Browse the repository at this point in the history
  • Loading branch information
tgturner committed Sep 21, 2018
1 parent 935c9c7 commit c1d6501
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/lib/roo/excelx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@
it 'returns the expected result when passed a number' do
expect(subject.sheet_for(0).instance_variable_get("@name")).to eq "Tabelle1"
end

it 'returns the expected result when passed a number that is not the first sheet' do
expect(subject.sheet_for(1).instance_variable_get("@name")).to eq "Name of Sheet 2"
end

it "should raise an error if passed a sheet that does not exist as an integer" do
expect { subject.sheet_for(10) }.to raise_error RangeError
end

it "should raise an error if passed a sheet that does not exist as a string" do
expect { subject.sheet_for("does_not_exist") }.to raise_error RangeError
end
end

describe '#row' do
Expand Down

0 comments on commit c1d6501

Please sign in to comment.