spec/writer_spec.rb in onix-0.8.4 vs spec/writer_spec.rb in onix-0.8.5
- old
+ new
@@ -1,16 +1,16 @@
# coding: utf-8
require File.dirname(__FILE__) + '/spec_helper.rb'
-context "ONIX::Writer" do
+describe ONIX::Writer do
before(:each) do
@output = StringIO.new
end
- specify "should output the correct xml metadata" do
+ it "should output the correct xml metadata" do
header = ONIX::Header.new
writer = ONIX::Writer.new(@output, header)
writer.end_document
lines = @output.string.split("\n")
@@ -20,11 +20,11 @@
# doctype
lines[1][0,9].should eql("<!DOCTYPE")
end
- specify "should output the correct xml metadata when used in block form" do
+ it "should output the correct xml metadata when used in block form" do
header = ONIX::Header.new
ONIX::Writer.open(@output, header) { |writer| }
lines = @output.string.split("\n")
@@ -33,21 +33,21 @@
# doctype
lines[1][0,9].should eql("<!DOCTYPE")
end
- specify "should output the header node" do
+ it "should output the header node" do
header = ONIX::Header.new
ONIX::Writer.open(@output, header) { |writer| }
lines = @output.string.split("\n")
lines[3][0,7].should eql("<Header")
end
- specify "should output the product node" do
+ it "should output the product node" do
header = ONIX::Header.new
product = ONIX::Product.new
ONIX::Writer.open(@output, header) do |writer|
writer << product
@@ -56,19 +56,19 @@
lines = @output.string.split("\n")
lines[4][0,8].should eql("<Product")
end
- specify "should correctly store finished state" do
+ it "should correctly store finished state" do
header = ONIX::Header.new
writer = ONIX::Writer.new(@output, header)
writer.finished?.should be_false
writer.end_document
writer.finished?.should be_true
end
=begin
- specify "should convert non-ASCII chars to references when outputting as a string" do
+ it "should convert non-ASCII chars to references when outputting as a string" do
header = ONIX::Header.new
header.from_person = "Hans Küng"
ONIX::Writer.open(@output, header) { |writer| }
@output.string.include?("Küng").should be_true