Skip to content
Open

Done #1189

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
6 changes: 6 additions & 0 deletions parrot.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Create method `parrot` that outputs a given phrase and
# returns the phrase

def parrot
puts "Squawk!"
end

parrot
22 changes: 0 additions & 22 deletions spec/parrot_spec.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
require_relative './spec_helper'
require_relative '../parrot.rb' # Code your solution in this file

describe '#parrot' do
it 'should output "Squawk!" to the terminal when called without any arguments' do
expect($stdout).to receive(:puts).with("Squawk!")
parrot
end

it 'should return the default phrase, "Squawk!" when called without any arguments' do
phrase = parrot
expect(phrase).to eq("Squawk!")
end

it 'should output the given phrase when called with an argument' do
expect($stdout).to receive(:puts).with("Pretty bird!")
parrot("Pretty bird!")
end

it 'should return the given phrase when called with an argument' do
phrase = parrot("Pretty bird!")

expect(phrase).to eq("Pretty bird!")
end
end