Sha256: beb17bb490c6bd41a6518de449feafa6bcaf4e2ec2866ca4d2d30eb8b8289c50

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe Cumuli::CLI::Commander do
  describe "#build" do
    let(:args) { mock({foreman_options: 'foreman-options-here'}) }
    let(:commander) { Cumuli::CLI::Commander.new(args) }

    context "application directory has no .rvmrc" do
      before do
        commander.stub(:rvmrc?).and_return(false)
      end

      it "has not rvm preface" do
        commander.build.should_not include('rvm')
      end
    end

    context "application directory has an .rvmrc" do
      before do
        commander.stub(:rvm_version).and_return('1.9.3')
        commander.stub(:rvmrc?).and_return(true)
      end

      it "has an rvm preface" do
        commander.build.should include('rvm ruby-1.9.3 exec')
      end
    end

    it "ends with a call to foreman" do
      commander.build.should match(/foreman start foreman-options-here$/)
    end

    describe "reading from the file system" do
      it "prefaces with the right rvm information" do
        Dir.chdir(File.dirname(__FILE__) + "/../fixtures/app_set/loopy") do
          commander.build.should include('rvm ruby-2.0.0')
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cumuli-0.2.1 spec/cli/commander_spec.rb
cumuli-0.2.0 spec/cli/commander_spec.rb