spec/zebra/epl/label_spec.rb in zebra-epl-0.0.6 vs spec/zebra/epl/label_spec.rb in zebra-epl-0.0.7

- old
+ new

@@ -20,10 +20,20 @@ it "sets the printing speed" do label = described_class.new :print_speed => 2 label.print_speed.should == 2 end + it "sets the number of copies" do + label = described_class.new :copies => 4 + label.copies.should == 4 + end + + it "the number of copies defaults to 1" do + label = described_class.new + label.copies.should == 1 + end + it "validates the printing speed" do [-1, 8, "a"].each do |s| expect { described_class.new :print_speed => s }.to raise_error(Zebra::Epl::Label::InvalidPrintSpeedError) @@ -61,10 +71,10 @@ label.width = 100 label.length_and_gap = [200, 24] label.print_speed = 3 label.print_density = 10 label.dump_contents(io) - io.should == "O\nQ200,24\nq100\nS3\nD10\n\nN\nfoobar\nblabla\nP0\n" + io.should == "O\nQ200,24\nq100\nS3\nD10\n\nN\nfoobar\nblabla\nP1\n" end it "does not try to set the label width when it's not informed (falls back to autosense)" do label.dump_contents(io) io.should_not =~ /q/