File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ Feature : Jokes Tool
2+ In order to make development process enjoyable,
3+ I should be able to read jokes from terminal
4+
5+ Scenario : Jokes can be read from CLI
6+ Given CLI jokes tool is installed
7+ When I execute "joke"
8+ Then I should see "Setup"
9+ And I should see "Punchline"
Original file line number Diff line number Diff line change 1010
1111driver = webdriver .PhantomJS ()
1212
13+ @given (u'CLI jokes tool is installed' )
14+ def step_impl (context ):
15+ execute ('./joke_installer_bash' )
16+
1317@given (u'a Ubuntu development machine' )
1418def step_impl (context ):
1519 pass
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ API_URL=" https://08ad1pao69.execute-api.us-east-1.amazonaws.com/dev/random_joke"
4+
5+ # Save jokes data
6+ OUTPUT=" /tmp/random_joke.txt"
7+ curl -sS " $API_URL " > " $OUTPUT "
8+
9+ # Parse setup and punchline
10+ SETUP=` cat $OUTPUT | jq ' .setup' `
11+ PUNCH=` cat $OUTPUT | jq ' .punchline' `
12+
13+ # Display setup and punchline
14+ printf " Setup: $SETUP \n"
15+ printf " Punchline: $PUNCH \n"
16+
17+ # Clean up temporary file
18+ rm " $OUTPUT "
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ sudo cp ./joke /usr/local/bin/joke
4+ sudo chmod +x /usr/local/bin/joke
You can’t perform that action at this time.
0 commit comments