Refactor how test formulas are installed in tests

This commit is contained in:
Baffour Adu Boampong 2020-08-12 14:24:21 +00:00
parent eea32b955b
commit 8acc72773a

View File

@ -1,13 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
require "utils/livecheck_formula" require "utils/livecheck_formula"
require "formula_installer"
describe LivecheckFormula do describe LivecheckFormula do
describe "init", :integration_test do describe "init" do
it "runs livecheck command for Formula" do let(:f) { formula { url "foo-1.0" } }
install_test_formula "testball" let(:options) { FormulaInstaller.new(f).display_options(f) }
let(:action) { "#{f.full_name} #{options}".strip }
formatted_response = described_class.init("testball") it "runs livecheck command for Formula" do
formatted_response = described_class.init(action)
expect(formatted_response).not_to be_nil expect(formatted_response).not_to be_nil
expect(formatted_response).to be_a(Hash) expect(formatted_response).to be_a(Hash)