-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 changed file
with
19 additions
and
0 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,19 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') | ||
|
||
def sample(type) | ||
File.open( File.expand_path(File.dirname(__FILE__) + "/../samples/#{type}.txt")) | ||
end | ||
|
||
describe OPDS::OPDSParser do | ||
|
||
[:entry, :acquisition, :navigation].each do |feed_type| | ||
it "should parse entry without error" do | ||
lambda { subject.parse(sample(feed_type)) }.should_not raise_error | ||
end | ||
|
||
it "should should sniff entry" do | ||
subject.parse(sample(feed_type)) | ||
subject.sniffed_type.should be(feed_type) | ||
end | ||
end | ||
end |