Created
November 24, 2009 21:38
-
-
Save mmower/242251 to your computer and use it in GitHub Desktop.
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
describe "Hospital Patient Chart" do | |
it "should have heart rate information" do | |
# heart rate information is numeric | |
# so it should be represented as a number | |
# it's implied that it's beats per minute | |
# (unless you're going to be storing it in | |
# some other format elsewhere) | |
HospitalPatientChart.new( 75 ).heart_rate.should == 75 | |
end | |
end | |
class HospitalPatientChart | |
# We don't obviously need a setter so I've used attr_reader. | |
attr_reader :heart_rate | |
def initialize(heart_rate) | |
@heart_rate = heart_rate | |
end | |
end | |
# It's a patients chart so likely to be their heart rate | |
patient_chart = HospitalPatientChart.new( 75 ) | |
puts patient_chart.heart_rate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment