From 17ad00a81a0f812242df6c7500f982b5892afc01 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Fri, 30 May 2014 15:35:49 +0000 Subject: [PATCH] Refactor registry feature --- .../{recipe_registry.feature => registry.feature} | 13 +++++++++---- features/task_registry.feature | 13 ------------- 2 files changed, 9 insertions(+), 17 deletions(-) rename features/{recipe_registry.feature => registry.feature} (54%) delete mode 100644 features/task_registry.feature diff --git a/features/recipe_registry.feature b/features/registry.feature similarity index 54% rename from features/recipe_registry.feature rename to features/registry.feature index 5cf984d..f4f2bb6 100644 --- a/features/recipe_registry.feature +++ b/features/registry.feature @@ -1,21 +1,26 @@ Feature: key/value registry - Scenario: `set' keyword registers a value in the registry + Scenario: `get' keyword in a task fetches a value registered with `set' Given a recipe with: """ set :some_key, 'some_value' - puts env.registry[:some_key] + task :registry_testing do + echo get :some_key + end """ When I successfully execute the recipe Then the output must contain "some_value" - Scenario: `get' keyword fetches a value from the registry + Scenario: `get' keyword fetches a value from the recipe Given a recipe with: """ set :some_key, 'some_value' + set :other_key, get(:some_key) - puts get :some_key + task :registry_testing do + echo get :other_key + end """ When I successfully execute the recipe Then the output must contain "some_value" diff --git a/features/task_registry.feature b/features/task_registry.feature deleted file mode 100644 index dc1270a..0000000 --- a/features/task_registry.feature +++ /dev/null @@ -1,13 +0,0 @@ -Feature: access to registry from task DSL - - Scenario: `get' keyword fetches a value from the registry - Given a recipe with: - """ - set :some_key, 'some_value' - - task :output_some_key do - echo get :some_key - end - """ - When I successfully execute the recipe - Then the output must contain "some_value"