Sha256: efea7893be5f4cec3dae5b9402444389c29fbc2b46b3b340a501da2f98f77aff

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

describe ToFactory::Finders::Factory do
  describe "#call" do
    before do
      FileUtils.mkdir_p "./tmp/factories/to_factory"
      FileUtils.cp "./spec/example_factories/#{version}_syntax/user_admin_with_header.rb",
        "./tmp/factories/to_factory/user.rb"
    end

    let(:user_file_contents) { File.read "./spec/example_factories/#{version}_syntax/user.rb"}
    let(:admin_file_contents){ File.read "./spec/example_factories/#{version}_syntax/admin.rb" }

    it "reads all the factories" do
      finder = ToFactory::Finders::Factory.new

      result = finder.call

      expect(result[0].definition).
        to match_sexp user_file_contents

      expect(result[1].definition).
        to match_sexp admin_file_contents
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
to_factory-0.2.1 spec/unit/finders/factory_spec.rb
to_factory-0.2.0 spec/unit/finders/factory_spec.rb