Skip to content

Commit 838cb89

Browse files
committed
Allow formats to not have readers (vocabulary is a write-only format).
1 parent 48f0a6a commit 838cb89

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/rdf/spec/format.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
describe ".reader" do
3636
it "returns a reader" do
3737
subject.each do |f|
38-
expect(f.reader).not_to be_nil
38+
format_namespace = f.name.split('::')[0..-2].inject(Kernel) {|base, const| base.const_get(const)}
39+
expect(f.reader).not_to be_nil if format_namespace.const_defined?(:Reader)
3940
end
4041
end
4142
end
@@ -46,7 +47,7 @@
4647
it "returns a writer" do
4748
subject.each do |f|
4849
format_namespace = f.name.split('::')[0..-2].inject(Kernel) {|base, const| base.const_get(const)}
49-
expect(f.writer).not_to be_nil if format_namespace.const_defined?(:Writer)
50+
expect(f.writer).not_to be_nil if format_namespace.const_defined?(:Writer)
5051
end
5152
end
5253
end

0 commit comments

Comments
 (0)