blob: 811ee51828c5a195a3f274779e364f56ae334762 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
require 'spec_helper'
describe Roo::Excelx do
subject { Roo::Excelx.new('test/files/strict.xlsx') }
example '#sheets' do
expect(subject.sheets).to eq %w(Sheet1 Sheet2)
end
example '#sheet' do
expect(subject.sheet('Sheet1')).to be_a(Roo::Excelx)
end
example '#cell' do
expect(subject.cell(1, 1)).to eq 'Sheet 1'
expect(subject.cell(1, 1, 'Sheet2')).to eq 'Sheet 2'
end
example '#row' do
expect(subject.row(1)).to eq ['Sheet 1']
expect(subject.row(1, 'Sheet2')).to eq ['Sheet 2']
end
example '#first_row' do
expect(subject.first_row).to eq 1
expect(subject.first_row('Sheet2')).to eq 1
end
example '#last_row' do
expect(subject.last_row).to eq 1
expect(subject.last_row('Sheet2')).to eq 1
end
example '#first_column' do
expect(subject.first_column).to eq 1
expect(subject.first_column('Sheet2')).to eq 1
end
example '#last_column' do
expect(subject.last_column).to eq 1
expect(subject.last_column('Sheet2')).to eq 1
end
end
|