Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specification/assets/gherkin/evaluation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Flag evaluation
# This test suite contains scenarios to test the flag evaluation API.

Background:
Given a provider is registered
Given a stable provider

# basic evaluation
Scenario: Resolves boolean value
Expand Down
49 changes: 49 additions & 0 deletions specification/assets/gherkin/hooks.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@hooks
Feature: Evaluation details through hooks

# This test suite contains scenarios to test the functionality of hooks.

Background:
Given a stable provider

Scenario: Passes evaluation details to after and finally hooks
Given a client with added hook
And a boolean-flag with key "boolean-flag" and a default value "false"
When the flag was evaluated with details
Then the "before" hook should have been executed
And the "after, finally after" hooks should be called with evaluation details
| data_type | key | value |
| string | flag_key | boolean-flag |
| boolean | value | true |
| string | variant | on |
| string | reason | STATIC |
| string | error_code | None |

# errors
Scenario: Flag not found
Given a client with added hook
And a string-flag with key "missing-flag" and a default value "uh-oh"
When the flag was evaluated with details
Then the "before" hook should have been executed
And the "error" hook should have been executed
And the "finally after" hooks should be called with evaluation details
| data_type | key | value |
| string | flag_key | missing-flag |
| string | value | uh-oh |
| string | variant | None |
| string | reason | ERROR |
| string | error_code | ErrorCode.FLAG_NOT_FOUND |

Scenario: Type error
Given a client with added hook
And a string-flag with key "wrong-flag" and a default value "13"
When the flag was evaluated with details
Then the "before" hook should have been executed
And the "error" hook should have been executed
And the "finally after" hooks should be called with evaluation details
| data_type | key | value |
| string | flag_key | wrong-flag |
| integer | value | 13 |
| string | variant | None |
| string | reason | ERROR |
| string | error_code | ErrorCode.TYPE_MISMATCH |