Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't kak on Pathname in excelx, openoffice #207

Merged
merged 1 commit into from
May 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/roo/excelx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def initialize(filename, options = {})

file_type_check(filename,'.xlsx','an Excel-xlsx', file_warning, packed)

@tmpdir = make_tmpdir(filename.split('/').last, options[:tmpdir_root])
@tmpdir = make_tmpdir(File.basename(filename), options[:tmpdir_root])
@filename = local_filename(filename, @tmpdir, packed)
@comments_files = []
@rels_files = []
Expand Down
2 changes: 1 addition & 1 deletion lib/roo/open_office.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(filename, options={})

@only_visible_sheets = options[:only_visible_sheets]
file_type_check(filename,'.ods','an Roo::OpenOffice', file_warning, packed)
@tmpdir = make_tmpdir(filename.split('/').last, options[:tmpdir_root])
@tmpdir = make_tmpdir(File.basename(filename), options[:tmpdir_root])
@filename = local_filename(filename, @tmpdir, packed)
#TODO: @cells_read[:default] = false
Zip::File.open(@filename) do |zip_file|
Expand Down
9 changes: 9 additions & 0 deletions spec/lib/roo/excelx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
expect(Roo::Excelx.new(path, cell_max: 100)).to be_a(Roo::Excelx)
end
end

context 'file path is a Pathname' do
let(:path) { Pathname.new('test/files/file_item_error.xlsx') }

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

end

describe '#cell' do
Expand Down
11 changes: 11 additions & 0 deletions spec/lib/roo/openoffice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
it 'creates an instance' do
expect(subject).to be_a(Roo::OpenOffice)
end

context 'file path is a Pathname' do
subject do
Roo::OpenOffice.new(Pathname.new('test/files/numbers1.ods'))
end

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

end

# OpenOffice is an alias of LibreOffice. See libreoffice_spec.
Expand Down