Skip to content

Commit f1d2d0f

Browse files
Rephrase to remove ambiguity
1 parent 8a28123 commit f1d2d0f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/analyzers/two_fer/analyze.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module TwoFer
44
no_module: "No module or class called TwoFer",
55
no_method: "No method called two_fer",
66
splat_args: "Rather than using *%s, how about actually setting a parameter called 'name'?",
7-
missing_default_param: "There is not a correct default param - the tests will fail",
7+
missing_default_param: "There is no correct default param - the tests will fail",
88
incorrect_default_param: "You could set the default value to 'you' to avoid conditionals",
99
string_building: "Rather than using string building, use interpolation",
1010
kernel_format: "Rather than using the format method, use interpolation",
@@ -146,7 +146,7 @@ def check_for_conditional_on_default_argument!
146146
# method rather than insist on it being the first line.
147147
return unless loc.type == :if
148148

149-
# Get the clause of the conditional (ie the bit after the "if" keyword)
149+
# Get the clause of the conditional (i.e. the bit after the "if" keyword)
150150
conditional = extract_conditional_clause(loc)
151151

152152
# Let's warn about using a better default if they `if name == nil`
@@ -155,7 +155,7 @@ def check_for_conditional_on_default_argument!
155155
disapprove!(:incorrect_default_param)
156156
end
157157

158-
# Same thing but if they do it the other way round, ie `if nil == name`
158+
# Same thing but if they do it the other way round, i.e. `if nil == name`
159159
if conditional.receiver == default_argument &&
160160
is_lvar?(conditional.first_argument, :name)
161161
disapprove!(:incorrect_default_param)

test/exercises/two_fer_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def self.two_fer
9494
}
9595
results = TwoFer::Analyze.(source)
9696
refute results[:approve]
97-
assert_equal ["There is not a correct default param - the tests will fail"], results[:messages]
97+
assert_equal ["There is no correct default param - the tests will fail"], results[:messages]
9898
end
9999

100100
def test_missing_default_value_fails
@@ -108,7 +108,7 @@ def self.two_fer(name)
108108
}
109109
results = TwoFer::Analyze.(source)
110110
refute results[:approve]
111-
assert_equal ["There is not a correct default param - the tests will fail"], results[:messages]
111+
assert_equal ["There is no correct default param - the tests will fail"], results[:messages]
112112
end
113113

114114
def test_splat_fails

0 commit comments

Comments
 (0)