Sha256: 708cd8b3c9d39b6eaecf9c2d2ff0d1faaf45abf96f27e21263f180f6e2b44342

Contents?: true

Size: 848 Bytes

Versions: 40

Compression:

Stored size: 848 Bytes

Contents

require "tmpdir"

require "librarian/error"
require "librarian/action/ensure"

module Librarian
  describe Action::Ensure do

    let(:env) { mock }
    let(:action) { described_class.new(env) }

    before do
      env.stub(:specfile_name) { "Specfile" }
    end

    describe "#run" do

      context "when the environment does not know its project path" do
        before { env.stub(:project_path) { nil } }

        it "should raise an error describing that the specfile is mising" do
          expect { action.run }.to raise_error(Error, "Cannot find Specfile!")
        end
      end

      context "when the environment knows its project path" do
        before { env.stub(:project_path) { Dir.tmpdir } }

        it "should not raise an error" do
          expect { action.run }.to_not raise_error
        end
      end

    end

  end
end

Version data entries

40 entries across 40 versions & 4 rubygems

Version Path
librarian-puppet-0.9.10 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.9 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-0.1.0 spec/unit/action/ensure_spec.rb
librarian-0.1.0.beta.1 spec/unit/action/ensure_spec.rb
librarian-puppet-lmco-0.9.8.2 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.8 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-maestrodev-0.9.7.5 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-maestrodev-0.9.7.4 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-maestrodev-0.9.7.3 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-0.0.26 spec/unit/action/ensure_spec.rb
librarian-puppet-maestrodev-0.9.7.2 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-maestrodev-0.9.7.1 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-maestrodev-0.9.7 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-0.0.25 spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.7 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.6 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.5 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.4 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.3 vendor/librarian/spec/unit/action/ensure_spec.rb
librarian-puppet-0.9.2 vendor/librarian/spec/unit/action/ensure_spec.rb