File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed
tests/exploratory/abortedfeature Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ Feature : Test summing numbers
2+ In order to test the basic
3+ features of radish I test
4+ to sum numbers.
5+
6+ Scenario : Sum two numbers
7+ Given I have the number 5
8+ And I have the number 3
9+ When I sum them
10+ Then I expect the result to be 8
11+
12+ Scenario : Sum three numbers
13+ Given I have the number 5
14+ And I have the number 3
15+ And I have the number 2
16+ When I sum them
17+ Then I expect the result to be 10
18+ Then I crash
Original file line number Diff line number Diff line change 1+ Feature : Test summing numbers
2+ In order to test the basic
3+ features of radish I test
4+ to sum numbers.
5+
6+ Scenario : Sum two numbers
7+ Given I have the number 5
8+ And I have the number 3
9+ When I sum them
10+ Then I expect the result to be 8
11+
12+ Scenario : Sum three numbers
13+ Given I have the number 5
14+ And I have the number 3
15+ And I have the number 2
16+ When I sum them
17+ Then I expect the result to be 10
Original file line number Diff line number Diff line change 1+ import sys
2+
3+ from radish import then , when
4+ from radish .stepregistry import step
5+
6+
7+ @step ("I have the number {number:g}" )
8+ def have_number (step , number ):
9+ step .context .numbers .append (int (number ))
10+
11+
12+ @when ("I sum them" )
13+ def sum_numbers (step ):
14+ step .context .result = sum (step .context .numbers )
15+
16+
17+ @then ("I expect the result to be {result:g}" )
18+ def expect_result (step , result ):
19+ assert step .context .result == result
20+
21+
22+ @then ("I crash" )
23+ def crash (step ):
24+ sys .exit (1 )
Original file line number Diff line number Diff line change 1+ from radish import before
2+
3+
4+ @before .each_scenario
5+ def init_numbers (scenario ):
6+ scenario .context .numbers = []
You can’t perform that action at this time.
0 commit comments