Sha256: 99c346077cf951c206afcfe7b0acb278a26b9f9e1d930cb6d40d3051d83380f5

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

describe Brewdler::Commands::Install do
  context "when a Brewfile is not found" do
    it "raises an error" do
      expect { Brewdler::Commands::Install.run }.to raise_error
    end
  end

  context "when a Brewfile is found" do
    it "does not raise an error" do
      Brewdler::BrewInstaller.stub(:install).and_return(true)
      Brewdler::CaskInstaller.stub(:install).and_return(true)
      Brewdler::RepoInstaller.stub(:install).and_return(true)

      File.stub(:read).and_return("tap 'phinze/cask'\nbrew 'git'\ncask 'google-chrome'")
      expect { Brewdler::Commands::Install.run }.to_not raise_error

      File.stub(:read => 'git', :open => ['git'])
      expect { Brewdler::Commands::Install.run }.to_not raise_error
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
brewdler-1.1.0 spec/install_command_spec.rb