aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/roo/excelx_spec.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-02-01 19:23:07 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-02-01 19:23:07 -0500
commit5a669c40673841aad681da3fe343c4a902a3bf6c (patch)
treeeec5e8bf16e20eef2f192ca056e8702d47c5d989 /spec/lib/roo/excelx_spec.rb
parenteeb0202b3730c4b9596b6b409f565e9f5a8dce4c (diff)
parent46eadd2724cd841328d90c3143a485fcdf423ed6 (diff)
Update upstream source from tag 'upstream/2.8.2'
Update to upstream version '2.8.2' with Debian dir b1ec8fbbaccffac36549be25adf232dec8fac090
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' }