summaryrefslogtreecommitdiffstats
path: root/spec/lib/roo/utils_spec.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-02-01 19:22:38 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-02-01 19:22:38 -0500
commit46eadd2724cd841328d90c3143a485fcdf423ed6 (patch)
treeeb23c011f1c80a4cce169d9d9523a28927770b12 /spec/lib/roo/utils_spec.rb
parent16dd018ca735392c2fb28b986316a9b22a06ccf9 (diff)
New upstream version 2.8.2upstream/2.8.2
Diffstat (limited to 'spec/lib/roo/utils_spec.rb')
-rw-r--r--spec/lib/roo/utils_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/roo/utils_spec.rb b/spec/lib/roo/utils_spec.rb
index 8f322d4..c000ae7 100644
--- a/spec/lib/roo/utils_spec.rb
+++ b/spec/lib/roo/utils_spec.rb
@@ -90,6 +90,19 @@ RSpec.describe ::Roo::Utils do
end
end
+ context '.coordinates_in_range' do
+ it "returns the expected result" do
+ expect(described_class.coordinates_in_range('').to_a).to eq []
+ expect(described_class.coordinates_in_range('B2').to_a).to eq [[2, 2]]
+ expect(described_class.coordinates_in_range('D2:G3').to_a).to eq [[2, 4], [2, 5], [2, 6], [2, 7], [3, 4], [3, 5], [3, 6], [3, 7]]
+ expect(described_class.coordinates_in_range('G3:D2').to_a).to eq []
+ end
+
+ it "raises an error when appropriate" do
+ expect { described_class.coordinates_in_range('D2:G3:I5').to_a }.to raise_error(ArgumentError)
+ end
+ end
+
context '.load_xml' do
it 'returns the expected result' do
expect(described_class.load_xml('test/files/sheet1.xml')).to be_a(Nokogiri::XML::Document)