spec/cell_spec.rb in rspreadsheet-0.4.9 vs spec/cell_spec.rb in rspreadsheet-0.5.0
- old
+ new
@@ -1,7 +1,6 @@
require 'spec_helper'
-require 'pry'
describe Rspreadsheet::Cell do
before do
book1 = Rspreadsheet.new
@sheet1 = book1.create_worksheet
@@ -238,10 +237,11 @@
end
it 'parse_time_value converts correcty different time values' do
dyear = 1899; dmonth = 12; dday = 30
Rspreadsheet::Cell.parse_time_value('PT923451H33M00S').should == Time.new(2005,5,5,3,33,00,0)
Rspreadsheet::Cell.parse_time_value('PT1H33M00S').should == Time.new(dyear,dmonth,dday,1,33,00,0)
+ Rspreadsheet::Cell.parse_time_value('11:50').should == Time.parse('11:50')
end
it 'handles time of day correctly on assignement' do
@sheet1.A11 = Rspreadsheet::Tools.new_time_value(2,13,27)
@sheet1.A12 = @sheet1.A11
@sheet1.A12.should == @sheet1.A11
@@ -364,7 +364,12 @@
it 'Does not ignore rows repeated on every page = header rows (issue 43)' do
sheet = Rspreadsheet.new('./spec/testfile-issue-42-43.ods').sheet(2)
sheet.A1.should == 'Schedule'
sheet.B2.should == 'Course'
sheet.A3.should == 'Teacher'
+ end
+ it 'responds by exception to unusual cases' do
+ cell = @sheet1.cell('A1')
+ cell.define_singleton_method(:mode) { :intenionally_unusual_mode_just_for_test }
+ expect { cell.value }.to raise_error(/Unknown cell mode/)
end
end