我在 RSpec 上描述课程
class Pupil
def initialize(name, dateOfBirth)
@name = name
@dateOfBirth = dateOfBirth
end
def name
@name
end
def ages
#should calculate ages
end
end
describe Pupil do
context do
pupil = Pupil.new("Stanislav Majewski", "1 april 1999")
it "should returns name" do
pupil.name.should eq("Stanislav Majewski")
end
it "should calculates ages" do
#not described
end
end
end
RSpec 返回:
..
Finished in 0.00203 seconds
2 examples, 0 failures
是否有一种优雅的方式来显示未描述该方法的失败消息?