brew/Library/Homebrew/test/rubocop_spec.rb
2020-02-19 11:24:12 +00:00

21 lines
502 B
Ruby

# frozen_string_literal: true
require "open3"
describe "RuboCop" do
context "when calling `rubocop` outside of the Homebrew environment" do
before do
ENV.each_key do |key|
ENV.delete(key) if key.start_with?("HOMEBREW_")
end
ENV["XDG_CACHE_HOME"] = "#{HOMEBREW_CACHE}/style"
end
it "loads all Formula cops without errors" do
_, _, status = Open3.capture3("rubocop", TEST_FIXTURE_DIR/"testball.rb")
expect(status).to be_a_success
end
end
end