Skip to content

Commit 95e0788

Browse files
authored
Merge pull request #836 from rubocop-hq/change-terminology
Change potentially offensive terminology
2 parents 0036374 + 9578d90 commit 95e0788

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/rubocop/cop/rspec/rails/http_status.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ class NumericStyleChecker
107107
MSG = 'Prefer `%<prefer>s` over `%<current>s` ' \
108108
'to describe HTTP status code.'
109109

110-
WHITELIST_STATUS = %i[error success missing redirect].freeze
110+
ALLOWED_STATUSES = %i[error success missing redirect].freeze
111111

112112
attr_reader :node
113113
def initialize(node)
114114
@node = node
115115
end
116116

117117
def offensive?
118-
!node.int_type? && !whitelisted_symbol?
118+
!node.int_type? && !allowed_symbol?
119119
end
120120

121121
def message
@@ -136,8 +136,8 @@ def symbol
136136
node.value
137137
end
138138

139-
def whitelisted_symbol?
140-
node.sym_type? && WHITELIST_STATUS.include?(node.value)
139+
def allowed_symbol?
140+
node.sym_type? && ALLOWED_STATUSES.include?(node.value)
141141
end
142142
end
143143
end

spec/rubocop/cop/rspec/context_wording_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@
7676
context 'when configured' do
7777
let(:cop_config) { { 'Prefixes' => %w[if] } }
7878

79-
it 'finds context without whitelisted prefixes at the beginning' do
79+
it 'finds context without allowed prefixes at the beginning' do
8080
expect_offense(<<-RUBY)
8181
context 'when display name is present' do
8282
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Start context description with 'if'.
8383
end
8484
RUBY
8585
end
8686

87-
it 'skips descriptions with whitelisted prefixes at the beginning' do
87+
it 'skips descriptions with allowed prefixes at the beginning' do
8888
expect_no_offenses(<<-RUBY)
8989
context 'if display name is present' do
9090
end

spec/rubocop/cop/rspec/rails/http_status_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
RUBY
6161
end
6262

63-
it 'does not register an offense when using whitelisted symbols' do
63+
it 'does not register an offense when using allowed symbols' do
6464
expect_no_offenses(<<-RUBY)
6565
it { is_expected.to have_http_status :error }
6666
it { is_expected.to have_http_status :success }

0 commit comments

Comments
 (0)