-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require_relative "../lib/hathifiles_database/db/connection" | ||
|
||
RSpec.describe HathifilesDatabase::Exception do | ||
describe HathifilesDatabase::Exception::WrongNumberOfColumns do | ||
let(:test_params) { {htid: "test.001", count: 22, expected: 33} } | ||
|
||
describe "#initialize" do | ||
it "creates a WrongNumberOfColumns object" do | ||
expect(described_class.new(**test_params)).to be_a HathifilesDatabase::Exception::WrongNumberOfColumns | ||
end | ||
end | ||
|
||
describe "#to_s" do | ||
it "includes the htid, expected, and count values" do | ||
@exc = described_class.new(**test_params) | ||
# HathifilesDatabase::Exception::WrongNumberOfColumns htid = test.001 has 22 items (expected 33) | ||
expect(@exc.to_s).to match "test.001" | ||
end | ||
end | ||
end | ||
end | ||
|
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