diff options
| author | 2023-02-08 00:40:16 -0500 | |
|---|---|---|
| committer | 2023-02-08 00:40:16 -0500 | |
| commit | b0bc0772184c68b8d4baac678c5fb707dc23af7f (patch) | |
| tree | 62c95563dd5d57e9db8268227acf4cc91e75af04 /spec/lib/roo | |
| parent | e44f5d5d1935ee40a6bbb232e649d91e8aa9ce74 (diff) | |
| parent | ae103e148eb3c15606b816505492d870ef062ad3 (diff) | |
Update upstream source from tag 'upstream/2.10.0'
Update to upstream version '2.10.0'
with Debian dir 3c0f78b1f632920ec992d7bf7e43a8b0ced0b21d
Diffstat (limited to 'spec/lib/roo')
| -rw-r--r-- | spec/lib/roo/base_spec.rb | 8 | ||||
| -rwxr-xr-x | spec/lib/roo/excelx_spec.rb | 35 |
2 files changed, 43 insertions, 0 deletions
diff --git a/spec/lib/roo/base_spec.rb b/spec/lib/roo/base_spec.rb index 76cefcc..9d44656 100644 --- a/spec/lib/roo/base_spec.rb +++ b/spec/lib/roo/base_spec.rb @@ -182,6 +182,14 @@ describe Roo::Base do end end + describe '#each_with_pagename' do + it 'should return an enumerator with all the rows' do + each_with_pagename = spreadsheet.each_with_pagename + expect(each_with_pagename).to be_a(Enumerator) + expect(each_with_pagename.to_a.last).to eq([spreadsheet.default_sheet, spreadsheet]) + end + end + describe '#each' do it 'should return an enumerator with all the rows' do each = spreadsheet.each diff --git a/spec/lib/roo/excelx_spec.rb b/spec/lib/roo/excelx_spec.rb index 7cc9b13..10b0caf 100755 --- a/spec/lib/roo/excelx_spec.rb +++ b/spec/lib/roo/excelx_spec.rb @@ -326,6 +326,30 @@ describe Roo::Excelx do expect(subject.formatted_value(4, 1)).to eq '05010' end end + + context 'contains US currency' do + let(:path) { 'test/files/currency-us.xlsx' } + + it 'returns a zero-padded number' do + expect(subject.formatted_value(4, 1)).to eq '$20.51' + end + end + + context 'contains euro currency' do + let(:path) { 'test/files/currency-euro.xlsx' } + + it 'returns a zero-padded number' do + expect(subject.formatted_value(4, 1)).to eq '€20.51' + end + end + + context 'contains uk currency' do + let(:path) { 'test/files/currency-uk.xlsx' } + + it 'returns a zero-padded number' do + expect(subject.formatted_value(4, 1)).to eq '£20.51' + end + end end describe '#row' do @@ -609,6 +633,17 @@ describe Roo::Excelx do end end + describe 'opening a file with filters' do + let(:path) { 'test/files/wrong_coordinates.xlsx' } + subject(:xlsx) do + Roo::Spreadsheet.open(path) + end + + it 'should properly extract defined_names' do + expect(subject.sheet(0).workbook.defined_names.length).to eq(1) + end + end + describe 'images' do let(:path) { 'test/files/images.xlsx' } |
