brew/Library/Homebrew/test/rubocop_spec.rb

23 lines
578 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
2018-09-05 00:58:28 +02:00
require "open3"
describe "RuboCop" do
context "when calling `rubocop` outside of the Homebrew environment" do
before do
2020-02-19 11:18:40 +00:00
ENV.each_key do |key|
2018-09-05 00:58:28 +02:00
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
stdout, _, status = Open3.capture3("rubocop", TEST_FIXTURE_DIR/"testball.rb")
expect(stdout).to include("no offenses detected")
2018-09-05 00:58:28 +02:00
expect(status).to be_a_success
end
end
end