Sha256: 2752b485ead8cfaeb384869cd5c696ff6aa301fb757540a341556649da837d9c

Contents?: true

Size: 778 Bytes

Versions: 1

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'init', type: :rake do
  before do
    load_default_config
  end

  it 'creates new deploy rb' do
    allow(File).to receive(:exist?).and_return(true)
    allow(File).to receive(:exist?).with('./config/deploy.rb').and_return(false)
    allow(FileUtils).to receive(:mkdir_p).and_return(true)
    allow(FileUtils).to receive(:cp).and_return(true)

    expect do
      task.invoke
    end.to output("-----> Created ./config/deploy.rb\nEdit this file, then run `mina setup` after.\n").to_stdout
  end

  it 'doesnt create deploy rb if already exists' do
    allow(File).to receive(:exist?).and_return(false)
    expect { task.invoke }.to raise_error(SystemExit).and output(/You already have/).to_stdout
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina-1.2.5 spec/tasks/init_spec.rb