spec/mork/grid_spec.rb in mork-0.6.0 vs spec/mork/grid_spec.rb in mork-0.7.0
- old
+ new
@@ -2,33 +2,33 @@
module Mork
describe Grid do
context 'init params' do
it 'does not work with an integer' do
- expect {Grid.new 1}.to raise_error
+ expect {Grid.new 1}.to raise_error RuntimeError
end
end
context 'default grid' do
before(:all) do
@grid = Grid.new 'spec/samples/layout.yml'
end
-
+
describe '#max_questions' do
it 'returns the maximum number of questions in a sheet' do
@grid.max_questions.should == 120
end
end
-
+
describe '#barcode_bits' do
it 'returns the number of bits used to define the form barcode' do
@grid.send(:barcode_bits).should == 40
end
end
end
-
+
# describe "#cell_x" do
# context "for 1st-column questions" do
# it "returns the distance from the registration frame of the left edge of the 1st choice" do
# grid.send(:cell_x,0,0).should == 7.5
# end
@@ -66,27 +66,27 @@
# grid.reg_marks(@image)
# end
# it "returns a hash" do
# grid.question_area(1).should be_an_instance_of(Hash)
# end
-#
+#
# it "returns the location in pixels of the first question patch" do
# c = grid.question_area(1)
# c[:x].should be_within(4).of(90)
# c[:y].should be_within(4).of(388)
# end
# it "returns the location in pixels of the 40th question patch" do
# c = grid.question_area(40)
# c[:x].should be_within(4).of(90)
# c[:y].should be_within(4).of(3120)
# end
-#
+#
# it "returns the location in pixels of the 121th question patch" do
# c = grid.question_area(121)
# c[:x].should be_within(4).of(1887)
# c[:y].should be_within(4).of(388)
# end
-#
+#
# it "returns the location in pixels of the last question patch" do
# c = grid.question_area(160)
# c[:x].should be_within(4).of(1887)
# c[:y].should be_within(4).of(3120)
# end