Sha256: 7214aa369473f4929fb5db54d76a2d4e6cf8a0bcabf282978ab1606a71ccc700

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

require 'janus/configuration'
require 'janus/command/initialize'

describe Janus::Command::Initialize do
  let(:command) { Janus::Command::Initialize.new }

  describe '#execute' do
    it 'writes samples configuration if file does not exist' do
      File.stub(:exists?) { false }

      source = File.expand_path('../../../../lib/janus/template/Janusfile', __FILE__)
      destination = 'Janusfile'
      FileUtils.should_receive(:copy).with(source, destination)

      command.execute
    end

    it 'raises error if file already exists' do
      File.stub(:exists?) { true }

      expect { command.execute }.to raise_error('A configuration file already exists!')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
janus-cli-0.1.0 spec/janus/command/initialize_spec.rb