Skip to content

Instantly share code, notes, and snippets.

@taq
Last active January 14, 2016 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taq/9f09fa8a3f3392afaa44 to your computer and use it in GitHub Desktop.
Save taq/9f09fa8a3f3392afaa44 to your computer and use it in GitHub Desktop.
Minitest without before_all
require "minitest/autorun"
require "minitest/spec"
require "spreadsheet"
describe 'spreadsheet' do
before do
@doc ||= Spreadsheet.open "spreadsheet.xls"
puts "document object id: #{@doc.object_id}"
end
it 'should have the correct number of rows on the first sheet' do
expect(@doc.worksheet(0).rows.size).must_equal 2047
end
it 'should have the correct number of rows on the second sheet' do
expect(@doc.worksheet(1).rows.size).must_equal 1054
end
it 'should have the correct number of rows on the third sheet' do
expect(@doc.worksheet(2).rows.size).must_equal 451
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment