Skip to content

Commit dbdbcaf

Browse files
committed
changing specs for readability
1 parent a0f6ec7 commit dbdbcaf

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

spec/variable_spec.rb

+5-9
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@
88
end
99

1010
it "defined a local variable called greeting and set it equal to 'Hello World'" do
11-
match = false
12-
right_answers.each do |a|
13-
if @content.match(a)
14-
match = true
15-
break
16-
end
17-
end
18-
expect(match).to eq(true)
11+
expect(right_answers.any? { |answer| @content.match(answer) }).to eq(true)
1912
end
2013

21-
it "should not be a global or instance variable" do
14+
it "should not be an instance variable" do
2215
expect(@content).to_not include("@")
2316
end
2417

18+
it "should not be an global variable" do
19+
expect(@content).to_not include("$")
20+
end
2521
end

variable.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Define a local variable called 'greeting',
22
# give it the value of the string "Hello World"
3+
4+
greeting = 'Hello World'

0 commit comments

Comments
 (0)