Created
November 24, 2015 19:03
-
-
Save taq/90b54cf88303d7f31dac to your computer and use it in GitHub Desktop.
Minitest with before_all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "minitest/autorun" | |
require "minitest/spec" | |
require "spreadsheet" | |
describe 'spreadsheet' do | |
def self.before_all | |
@doc ||= Spreadsheet.open "spreadsheet.xls" | |
end | |
before do | |
@doc = self.class.before_all | |
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