diff --git a/README.md b/README.md index c0261b5..2be117a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/furlong.rb b/furlong.rb index 9b7e2b4..1321826 100644 --- a/furlong.rb +++ b/furlong.rb @@ -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 \ No newline at end of file diff --git a/furlong_spec.rb b/furlong_spec.rb index 053ebfd..08c249a 100644 --- a/furlong_spec.rb +++ b/furlong_spec.rb @@ -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 \ No newline at end of file