diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d808054..8469dad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ on: jobs: run: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/src/Context/RedisContext.php b/src/Context/RedisContext.php index a6ad449..cdc3c29 100644 --- a/src/Context/RedisContext.php +++ b/src/Context/RedisContext.php @@ -55,12 +55,12 @@ public function iSaveStringParamsToRedis(string $value, string $key): void * * @When /^I see in redis value "([^"]*)" by key "([^"]*)"$/ */ - public function iSeeInRedisValueByKay(string $value, string $key): void + public function iSeeInRedisValueByKey(string $value, string $key): void { $found = $this->redis->get($key); if (!$found) { - throw new InvalidArgumentException(sprintf('In Redis does not data in key "%s"', $key)); + throw new InvalidArgumentException(sprintf('In Redis does not exist data for key "%s"', $key)); } if ($value !== $found) { @@ -73,6 +73,18 @@ public function iSeeInRedisValueByKay(string $value, string $key): void } } + /** + * @When /^I don't see in redis value by key "([^"]*)"$/ + */ + public function iDontSeeInRedisValueByKey(string $key): void + { + $found = $this->redis->get($key); + + if ($found) { + throw new InvalidArgumentException(sprintf('Redis contains data for key "%s"', $key)); + } + } + /** * @param string $key * @param PyStringNode $string