Sha256: 89c210562d278e1df4f1166752d8a70e04e176120d09a040b2ca225e79d774dc

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 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
      allow(Brewdler::BrewInstaller).to receive(:install).and_return(true)
      allow(Brewdler::CaskInstaller).to receive(:install).and_return(true)
      allow(Brewdler::RepoInstaller).to receive(:install).and_return(true)

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

      allow(File).to receive(:read).and_return('git')
      allow(File).to receive(:open).and_return('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.1 spec/install_command_spec.rb