So I'm trying to write some code to make an RSPEC test pass for Ruby. But I'm having some trouble even getting the first test to pass. I think if I can have a little help with this, I'll be able to get the rest. But I can post the rest of the tests if that makes it easier to offer advice.
So it's constructing a fahrenheit/celsius converter, but using objects and classes instead of just defining a couple of methods to do the conversions.
The first part looks like this
require "temperature"
describe Temperature do
describe "can be constructed with an options hash" do
describe "in degrees fahrenheit" do
it "at 50 degrees" do
Temperature.new(:f => 50).in_fahrenheit.should == 50
end
One of the hints in the instructions says that the Temperature object constructer should accept an options hash with either a :celsius or :fahrenheit entry.
Any help or hints would be greatly appreciated. I've been stuck on this test for the last few weeks. Thanks in advance.