Sha256: 0707a6e8e535c08ed9a886df4cc1dfb046e38526da1c04bddf81ef4d52aa7307

Contents?: true

Size: 629 Bytes

Versions: 1

Compression:

Stored size: 629 Bytes

Contents

require 'spec_helper'

describe DataForge::File::RecordFileDefinition do

  describe ".from_input" do
    it "should instantiate a CSV file definition and initalize it with the initializer block" do
      definition = instance_double "DataForge::File::CSV::CSVRecordFileDefinition"
      initializer_block = lambda {}

      expect(DataForge::File::CSV::CSVRecordFileDefinition).to receive(:new).with(:test).and_return definition
      expect(definition).to receive(:instance_eval) { |&block| expect(block).to be initializer_block }

      expect(subject.from_input :test, &initializer_block).to eq definition
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
data_forge-0.1 spec/data_forge/file/record_file_definition_spec.rb