-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This is the dog class | ||
class Dog | ||
def initialize(name) | ||
@name = name | ||
end | ||
|
||
# This method is currently covered by a test | ||
def name | ||
"#{@name}!!!" | ||
end | ||
|
||
# FIXME: add a condition | ||
# This method is NOT currently covered by a test | ||
def age_in_dog_years | ||
46 | ||
end | ||
|
||
def age_in_human_years | ||
9 | ||
end | ||
|
||
def bark | ||
name | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
require "dog" | ||
|
||
RSpec.describe Dog do | ||
describe "#name" do | ||
it "is super excited about its name" do | ||
expect(Dog.new("Milo").name).to eq("Milo!!!") | ||
end | ||
end | ||
|
||
describe "#age_in_dog_years" do | ||
it "is 45 for some reason" do | ||
expect(Dog.new("Milo").age_in_dog_years).to eq 46 | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe Sample do | ||
it "can add two numbers" do | ||
expect(Sample.add(3,4)).to eq(7) | ||
end | ||
# it "can add two numbers" do | ||
# expect(Sample.add(3,4)).to eq(7) | ||
# end | ||
|
||
it "can add subtract numbers" do | ||
expect(Sample.subtract(5,2)).to eq(3) | ||
end | ||
|
||
it "can add multiply numbers" do | ||
expect(Sample.multiply(5,2)).to eq(10) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters