Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
ruby '2.0.0'
# ruby '2.0.0'

gem 'rspec', '~> 3.0.0.beta2'
12 changes: 10 additions & 2 deletions lib/deaf_grandma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ def run!
end
end


def speak(input)

#Implement your code here <<<<<<<<<

if input.downcase == "bye"
@bye_counter += 1
if @bye_counter == 3
"SEE YOU LATER SONNY!"
end
elsif input != input.upcase
"SPEAK UP SONNY!"
elsif input == input.upcase
"NOT SINCE 1964!"
end
end

private
Expand Down
10 changes: 9 additions & 1 deletion lib/fizzbuzz.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
class SuperFizzBuzz

def run(input)

#Implement your code here

if input % 3 == 0 && input % 5 == 0
"FizzBuzz"
elsif input % 3 == 0
"Fizz"
elsif input % 5 == 0
"Buzz"
else
input
end
end

end
Expand Down
6 changes: 6 additions & 0 deletions spec/deaf_grandma_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@

it "says 'NOT SINCE 1964!' when we yell" do
#implement your test here
expect(script.speak("HI")).to eq "NOT SINCE 1964!"
end

it "EXTRA CREDIT: How would you test yelling BYE?" do
#implement your test here
2.times do
script.speak("bye")
end

expect(script.speak("bye")).to eq "SEE YOU LATER SONNY!"
end
end
3 changes: 3 additions & 0 deletions spec/fizzbuzz_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@

it "returns 'Buzz' when my input is divisible by 5" do
#implement your test here
expect(script.run(5)).to eq "Buzz"
end

it "returns 'FizzBuzz' when input is divisible by 3 & 5" do
#implement your test here
expect(script.run(15)).to eq "FizzBuzz"
end

it "returns the input number when input isn't divisible by 3, 5, or both" do
#implement your test here
expect(script.run(8)).to eq 8
end
end