spec/table_spec.rb in rubyfromexcel-0.0.4 vs spec/table_spec.rb in rubyfromexcel-0.0.5
- old
+ new
@@ -76,11 +76,11 @@
end
it "should be able to translate structured references that include the special variable #This Row" do
table.reference_for('[#This Row],[ColA]', Reference.new('e5')).to_s.should == 'sheet1.b5'
table.reference_for('#This Row',Reference.new('e5')).start_cell.to_s.should == 'b5'
- table.reference_for('#This Row',Reference.new('e5')).end_cell.to_s.should == 'd5'
+ table.reference_for('#This Row',Reference.new('e5')).end_cell.to_s.should == 'd5'
end
it "should be able to translate structured references from cells that are in the table, treating them as if they had indicated [#This row] as part of the reference" do
table.reference_for('ColA', Reference.new('e5',@worksheet)).to_s.should == "sheet1.a('b4','b6')"
table.reference_for('ColA', Reference.new('c5',@worksheet)).to_s.should == 'sheet1.b5'
@@ -89,9 +89,14 @@
it "should be able to access structured references by providing the table name to Table.reference_for(table_name,structured_reference,referring_cell)" do
table
Table.reference_for('FirstTable','#Data').start_cell.to_s.should == 'b4'
Table.reference_for('Not a known table','#Data').should == ":ref"
Table.reference_for('FirstTable','[#This Row],[ColA]', Reference.new('e5')).to_s.should == 'sheet1.b5'
+ end
+
+ it "should be able to deal with a column range, returning a range" do
+ table
+ Table.reference_for('FirstTable','[#This Row],[ColA]:[ColC]', Reference.new('e5')).to_s.should == "sheet1.a('b5','d5')"
end
it "#inspect should create a string that can be used to recreate the table" do
table.inspect.should == %Q{'Table.new(sheet1,"FirstTable","B3:D7",["ColA", "ColB", "ColC"],1)'}
end
\ No newline at end of file