Sha256: f765ef3a4c5d677d9957b650abe2a7bf3ac2b3a93e8b615f2196c77c532fc0a7

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

describe Cumuli::CLI::Commander do
  describe "#build" do
    let(:command) { 'foreman start -p 3030' }
    let(:commander) { Cumuli::CLI::Commander.new(command) }

    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 "concludes with the command" do
      commander.build.should match(/#{command}$/)
    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

7 entries across 7 versions & 1 rubygems

Version Path
cumuli-0.5.0 spec/cli/commander_spec.rb
cumuli-0.4.1 spec/cli/commander_spec.rb
cumuli-0.4.0 spec/cli/commander_spec.rb
cumuli-0.3.4 spec/cli/commander_spec.rb
cumuli-0.3.2 spec/cli/commander_spec.rb
cumuli-0.3.1 spec/cli/commander_spec.rb
cumuli-0.3.0 spec/cli/commander_spec.rb