Branch | Travis CI | Code Coverage |
---|---|---|
master | ||
develop |
-
Make sure you have metacello-work installed in your image.
-
Follow the following Guide for the git repo setup If you follow the guide there is no need for Step 3.
-
AcceptIt can be acquired by running following code in the workspace:
Metacello new
baseline: 'AcceptIt';
repository: 'github://hpi-swa-teaching/AcceptIt/packages';
get;
load
-
Choose a class to test like for example "MySuperCalculator"
-
Create a user story by running the following code in the workspace:
ACUserStory userStoryNamed: 'ACCalculatorUserStory'
story:
'AC Calculator User Story
In order to test my sophisticated calculator class
As a developer
I want to do some complicated calculations'
withCategory: 'acceptitTest-calculator'
fullText:
'AC Calculator User Story
In order to test my sophisticated calculator class
As a developer
I want to do some complicated calculations'.
- Create a library by running the following code in the workspace:
ACLibrary generateNewLibrary: #MySuperCalculator
- Add a
libraries
method on class side to your user story class and make it return the class of it's library
libraries
^ {MySuperCalculatorLibrary}
- write the test scenario in your user story
minimal viable user story
Given A is true
When I do nothing
Then I expect A to be true
- Add needed methods to the library like
(given) A is :aBool
self class a: aBool
(when) I do nothing
(then) I expect A to be :aBool
assert: [self class a = aBool]
- Add the according methods on class side (also add an instance variable
a
on class side):
a: aBool
a := aBool.
a
^a
- Run the Test-Runner
ACTestRunner open