Sha256: ea1e48908021086b4e9891bd4899b348d9d9224598f38bf925929747e98aa61b

Contents?: true

Size: 816 Bytes

Versions: 16

Compression:

Stored size: 816 Bytes

Contents

require 'mccloud'
require 'fileutils'
require 'tempfile'

describe "Init command" do

  before(:each) do
   @tempdir = Dir.mktmpdir
   @env=Mccloud::Environment.new(:cwd => @tempdir,:autoload => false)
  end

  after(:each) do
    @env=nil
    FileUtils.remove_entry_secure @tempdir
  end

  it "When I run an mccloud init from an empty directory, it should create a new Mccloudfile" do
    args=["init"]
    ::Mccloud::CLI.start(args,:env => @env)
    File.exists?(File.join(@tempdir,"Mccloudfile")).should be_true
  end

  it "When I run an mccloud init in a directory that already has a Mccloudfile, it should error" do
    args=["init"]
    ::Mccloud::CLI.start(args,:env => @env)
    @env.ui.should_receive(:error).at_least(1).times.with(/already exists/)
    ::Mccloud::CLI.start(args,:env => @env)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 spec/commands/init_spec.rb
mccloud-0.0.28 spec/commands/init_spec.rb
mccloud-0.0.27 spec/commands/init_spec.rb
mccloud-0.0.26 spec/commands/init_spec.rb
mccloud-0.0.25 spec/commands/init_spec.rb
mccloud-0.0.24 spec/commands/init_spec.rb
mccloud-0.0.23 spec/commands/init_spec.rb
mccloud-0.0.22 spec/commands/init_spec.rb
mccloud-0.0.21 spec/commands/init_spec.rb
mccloud-0.0.20 spec/commands/init_spec.rb
mccloud-0.0.19 spec/commands/init_spec.rb
mccloud-0.0.18 spec/commands/init_spec.rb
mccloud-0.0.17 spec/commands/init_spec.rb
mccloud-0.0.16 spec/commands/init_spec.rb
mccloud-0.0.15 spec/commands/init_spec.rb
mccloud-0.0.14 spec/commands/init_spec.rb