?????????????????????????????????
???????????? ???????[ 2011/10/13 9:39:18 ] ????????
????TDD?????
????JUnit?????????????????????????????Unit Test Framework??????TDD????????????ε???? ?????????????????????????????????????????????????????????TDD???????????????????????????Working Effectively with legacy code????????????????Xunit Test Patterns??????Щ??????????????????????????·????????????????????????????·??
?????? ???е?TDD?е?T??????????????????????????????????????????????????????????????????????·?????????????????????Automate Acceptance Test Driven Development??AATDD??????????????????????Fitnesse??
?????? ???е?????????????????????????????????????????????????
????BDD??????
?????????????????Behavior Driven development??BDD???????????????????????????????????????????????????????????????????????????????
def test_valid_point ->
2 def test_point_should_support_set_integer_to_x_and_y
3
4 def test_invalid_point ->
5 def test_point_should_raise_error_when_set_none_integer_to_x_and_y
??????????Ruby??BDD?????Rspec??????????????????????????????????
describe "A new point" do
02 it "should raise exception when set none integer as x or y" do
03 none_integers = [[nil?? 3]?? [3?? nil]?? [1?? -2]?? [-2?? 1]?? [1.5?? 2]?? [2?? 1.5]]
04 none_integers.each do |ni|
05 Point.new(ni[0]?? ni[1]).should raise_error()
06 end
07 end
08 it "should accept when set integer as x and y" do
09 integers = [[1?? 2]?? [0?? 0]]
10 integers.each do |i|
11 p = Point.new(i[0]?? i[1])
12 p.x.should == i[0]
13 p.y.should == i[1]
14 end
15 end
16 end
????Rspec?????????????????Ч?£?????Spec????????????????????????????????????????????????Rspec??????????????????describe/it/do?????棬??????????????????????Spec??????????????????????Cucumber??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11