spec/csv2hash_spec.rb in csv2hash-0.6.2 vs spec/csv2hash_spec.rb in csv2hash-0.6.3

- old
+ new

@@ -1,17 +1,20 @@ require 'spec_helper' -describe Csv2hash do - let(:definition) { double('definition', type: nil) } - let(:data_source) { nil } +module Csv2hash + describe Main do + let(:config_file) { 'config/rules.yml' } + let(:loader) { YamlLoader.new(config_file).tap &:load! } + let(:data_source) { 'config/example.csv' } - subject do - Csv2hash::Main.new(definition, data_source, ignore_blank_line: false) - end + subject do + Main.new(loader.definition, data_source, ignore_blank_line: false) + end - context '...' do - specify do - expect(subject.options.fetch(:ignore_blank_line)).to eql(false) + context '...' do + specify do + expect(subject.options.fetch(:ignore_blank_line)).to eql(false) + end end - end + end end