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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Show Notes

Recomendations:

* If RSpec looks like to you, use it
* If RSpec looks good to you, use it
* Otherwise, use Minitest
* Use what your team likes

Expand Down
5 changes: 5 additions & 0 deletions furlong.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ class Furlong
def miles_to_kilometers(miles)
miles * KM_PER_MILE
end

KM_PER_FURLONG = 0.201168
def furlongs_to_kilometers(furlongs)
furlongs * KM_PER_FURLONG
end
end
4 changes: 4 additions & 0 deletions furlong_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
it "converts a marathon: 26.219 miles to 42.194988 km" do
subject.miles_to_kilometers(26.219).should be_within(0.001).of(42.194988)
end

it "converts a furlong to 0.201168 km" do
subject.furlongs_to_kilometers(1).should be_within(0.001).of(0.201168)
end
end