summaryrefslogtreecommitdiffstats
path: root/spec/lib/roo/excelx_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/excelx_spec.rb
parent16dd018ca735392c2fb28b986316a9b22a06ccf9 (diff)
New upstream version 2.8.2upstream/2.8.2
Diffstat (limited to 'spec/lib/roo/excelx_spec.rb')
-rwxr-xr-xspec/lib/roo/excelx_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/roo/excelx_spec.rb b/spec/lib/roo/excelx_spec.rb
index 6c2289f..1b67a4d 100755
--- a/spec/lib/roo/excelx_spec.rb
+++ b/spec/lib/roo/excelx_spec.rb
@@ -379,9 +379,34 @@ describe Roo::Excelx do
expect(subject.hyperlink?(1, 1)).to eq true
expect(subject.hyperlink?(1, 2)).to eq false
end
+
+ context 'defined on cell range' do
+ let(:path) { 'test/files/cell-range-link.xlsx' }
+
+ it 'returns the expected result' do
+ [[false]*3, *[[true, true, false]]*4, [false]*3].each.with_index(1) do |row, row_index|
+ row.each.with_index(1) do |value, col_index|
+ expect(subject.hyperlink?(row_index, col_index)).to eq(value)
+ end
+ end
+ end
+ end
end
describe '#hyperlink' do
+ context 'defined on cell range' do
+ let(:path) { 'test/files/cell-range-link.xlsx' }
+
+ it 'returns the expected result' do
+ link = "http://www.google.com"
+ [[nil]*3, *[[link, link, nil]]*4, [nil]*3].each.with_index(1) do |row, row_index|
+ row.each.with_index(1) do |value, col_index|
+ expect(subject.hyperlink(row_index, col_index)).to eq(value)
+ end
+ end
+ end
+ end
+
context 'without location' do
let(:path) { 'test/files/link.xlsx' }