File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require "open3"
4+ require "yaml"
45
56RSpec . describe "RuboCop" do
67 context "when calling `rubocop` outside of the Homebrew environment" do
2324 expect ( status ) . to be_a_success
2425 end
2526 end
27+
28+ describe "configuration" do
29+ it "has TargetRubyVersion matching .ruby-version" do
30+ rubocop_config_path = HOMEBREW_LIBRARY_PATH . parent /".rubocop.yml"
31+ rubocop_config = YAML . unsafe_load_file ( rubocop_config_path )
32+ target_ruby_version = rubocop_config . dig ( "AllCops" , "TargetRubyVersion" )
33+
34+ ruby_version_path = HOMEBREW_LIBRARY_PATH /".ruby-version"
35+ ruby_version = ruby_version_path . read . strip . to_f
36+
37+ expect ( target_ruby_version ) . to eq ( ruby_version )
38+ end
39+ end
2640end
You can’t perform that action at this time.
0 commit comments