test/xlsx_reader_test.rb in iostreams-1.1.0 vs test/xlsx_reader_test.rb in iostreams-1.1.1

- old
+ new

@@ -1,32 +1,32 @@ -require_relative 'test_helper' -require 'csv' +require_relative "test_helper" +require "csv" class XlsxReaderTest describe IOStreams::Xlsx::Reader do let :file_name do - File.join(File.dirname(__FILE__), 'files', 'spreadsheet.xlsx') + File.join(File.dirname(__FILE__), "files", "spreadsheet.xlsx") end let :xlsx_contents do [ - ['first column', 'second column', 'third column'], - ['data 1', 'data 2', 'more data'] + ["first column", "second column", "third column"], + ["data 1", "data 2", "more data"] ] end - describe '.file' do - describe 'with a file path' do - it 'returns the contents of the file' do + describe ".file" do + describe "with a file path" do + it "returns the contents of the file" do csv = IOStreams::Xlsx::Reader.file(file_name, &:read) assert_equal xlsx_contents, CSV.parse(csv) end end - describe 'with a file stream' do - it 'returns the contents of the file' do - csv = '' - File.open(file_name, 'rb') do |file| + describe "with a file stream" do + it "returns the contents of the file" do + csv = "" + File.open(file_name, "rb") do |file| csv = IOStreams::Xlsx::Reader.stream(file, &:read) end assert_equal xlsx_contents, CSV.parse(csv) end