????Rspec ??Ruby?????????????????????????£??????м??????????????y????
??????????????????
?????????????????????????????磺 testlink ???????????????????????????????????????????????磺 TestNg ???????????????????????????
????Rspec??????
???????????Rspec??????? describe??it ???????鹹??
??????????????Rspec????? BDD ?????????????д????????? ??????????testcase?? ?????
????describe?????????describe??it??????????????
????it???????????????????????????????????????????????????Assertion?????????????
??????????????
????????????????????????????????????·?????????????????

 

# encoding: utf-8
describe 'PHILIPS??? - ???????' do
# Rspec????????DSL ?????п?????????Ruby???? ???????echo()????
def echo(input)
puts input
end
# Rspec??TestNG/JUnit??? ???????before/after??hook
# ?????÷?Χ????????describe
# before??it?????????
before(:each) do
echo '--- ??????β??? ---'
end
# after??it??????????
after(:each) do
echo "--- ???????β??? --- "
end
it "e?????????? - ?????? - ???????" do
echo '???? - ?????? - ??????'
end
# describe??????it???鰱?? ???? "e?????" ?? "???????"
# describe????????? ????????????????? ???????????????
describe '???????' do
describe '??????' do
# it?????????????????testcase
it '??????????' do
echo 'min-1-2-3-4-5-max'
end
it '????????ó???10000' do
echo 'no more than 1w'
end
it "??????????" do
echo 'white light'
end
end
describe '??????' do
it "?????????" do
echo '???????'
end
it "?С???粻????0.000001??" do
echo '0.000001kwh'
end
end
end