File: libreoffice_spec.rb

package info (click to toggle)
ruby-roo 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,216 kB
  • sloc: ruby: 6,529; xml: 88; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 742 bytes parent folder | download | duplicates (5)
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
require 'spec_helper'

describe Roo::LibreOffice do
  describe '.new' do
    subject do
      Roo::LibreOffice.new('test/files/numbers1.ods')
    end

    it 'creates an instance' do
      expect(subject).to be_a(Roo::LibreOffice)
    end
  end

  describe '#sheets' do
    let(:path) { 'test/files/hidden_sheets.ods' }

    describe 'showing all sheets' do
      it 'returns the expected result' do
        expect(Roo::LibreOffice.new(path).sheets).to eq ["HiddenSheet1", "VisibleSheet1", "HiddenSheet2"]
      end
    end

    describe 'only showing visible sheets' do
      it 'returns the expected result' do
        expect(Roo::LibreOffice.new(path, only_visible_sheets: true).sheets).to eq ["VisibleSheet1"]
      end
    end
  end
end