Skip to content

Commit 8dabc51

Browse files
committed
Add test to be sure CLI passes parsed prefixes to a writer.
1 parent 340ab71 commit 8dabc51

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

spec/cli_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@
180180
RDF::CLI.exec(["serialize", TEST_FILES[:nt]], output_format: :nquads)
181181
}.to write.to(:output)
182182
end
183+
184+
it "passes parsed prefixes to writer" do
185+
allow_any_instance_of(RDF::NTriples::Reader).to receive(:prefixes).and_return(foo: :bar)
186+
187+
writer_mock = double("writer")
188+
expect(RDF::Writer).to receive(:for).and_return(writer_mock)
189+
expect(writer_mock).to receive(:new).with(anything, hash_including(prefixes: {foo: :bar}))
190+
RDF::CLI.exec(["serialize", TEST_FILES[:nt]], output_format: :nquads)
191+
end
183192
end
184193

185194
it "help" do

0 commit comments

Comments
 (0)