Skip to content

Commit

Permalink
Fixing the rules response
Browse files Browse the repository at this point in the history
  • Loading branch information
synedra committed Dec 19, 2017
1 parent 4e1f12b commit 47f8603
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
49 changes: 49 additions & 0 deletions bats/general-options.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@test "Bare bin/akamaiProperty shows usage" {
run bin/akamaiProperty
[ $status -eq 0 ]
[ $(expr "${lines[0]}" : "Usage:") -ne 0 ]
[ "${#lines[@]}" -gt 10 ]
[ $(expr "$output" : ".*config.*") -ne 0 ]
[ $(expr "$output" : ".*section.*") -ne 0 ]
}
@test "Akamai subcommands show usage" {
run bin/akamaiProperty modify
[ $status -eq 1 ]
[ $(expr "${lines[0]}" : "Usage:") -ne 0 ]
[ "${#lines[@]}" -gt 10 ]
[ $(expr "$output" : ".*config.*") -ne 0 ]
[ $(expr "$output" : ".*section.*") -ne 0 ]
}

@test "Akamai subcommands work with pre help" {
run bin/akamaiProperty help modify
[ $status -eq 0 ]
[ $(expr "${lines[0]}" : "Usage:") -ne 0 ]
[ "${#lines[@]}" -gt 10 ]
[ $(expr "$output" : ".*config.*") -ne 0 ]
[ $(expr "$output" : ".*section.*") -ne 0 ]
}

@test "Akamai subcommands work with help flag (--help)" {
run bin/akamaiProperty modify --help
[ $status -eq 0 ]
[ $(expr "${lines[0]}" : "Usage:") -ne 0 ]
[ "${#lines[@]}" -gt 10 ]
[ $(expr "$output" : ".*config.*") -ne 0 ]
[ $(expr "$output" : ".*section.*") -ne 0 ]
}

@test "Create a new test property $PROPERTYNAME" {
run bin/akamaiProperty create $PROPERTYNAME --clone akamaiapibootcamp.com
echo "status = ${status}"
echo "output = ${output}"
[ $status -eq 0 ]
}

@test "Delete test property $PROPERTYNAME" {
run bin/akamaiProperty delete $PROPERTYNAME
echo "status = ${status}"
echo "output = ${output}"
[ $status -eq 0 ]
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "akamaicliproperty",
"version": "0.1.0",
"version": "0.1.1",
"description": "A wrapping development kit to interface common tasks with akamai's {OPEN} API.",
"repository": "https://github.com/akamai/cli-property",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/website.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ class WebSite {
let newRules = JSON.parse(response.body);
resolve(newRules);
} else {
reject(response);
reject(response.body);
}
});
});
Expand Down

0 comments on commit 47f8603

Please sign in to comment.