Sha256: 8c086ec097ec0adaa7faf8561e45929eef6b250ac1b5ec9d01bbfc258af65b50

Contents?: true

Size: 875 Bytes

Versions: 5

Compression:

Stored size: 875 Bytes

Contents

module SandthornSequelProjection
  describe Runner do

    module FakeProjection
      def initialize(*); end
      def migrate!; end
      def update!; end
    end

    class Projection1; include FakeProjection; end
    class Projection2; include FakeProjection; end

    let(:manifest) { Manifest.new(Projection1, Projection2) }

    let(:runner) { SandthornSequelProjection::Runner.new(manifest) }

    describe "#run" do
      it "migrates all projections" do
        expect_any_instance_of(Projection1).to receive(:migrate!).once
        expect_any_instance_of(Projection2).to receive(:migrate!).once
        runner.run(false)
      end

      it "updates all projections" do
        expect_any_instance_of(Projection1).to receive(:update!).once
        expect_any_instance_of(Projection2).to receive(:update!).once
        runner.run(false)
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sandthorn_sequel_projection-0.1.0 spec/runner_spec.rb
sandthorn_sequel_projection-0.0.4 spec/runner_spec.rb
sandthorn_sequel_projection-0.0.3 spec/runner_spec.rb
sandthorn_sequel_projection-0.0.2 spec/runner_spec.rb
sandthorn_sequel_projection-0.0.1 spec/runner_spec.rb