diff --git a/tests/featurelib/zanshincontext.h b/tests/featurelib/zanshincontext.h --- a/tests/featurelib/zanshincontext.h +++ b/tests/featurelib/zanshincontext.h @@ -42,11 +42,10 @@ void doDisplayMessage(const QString &) override; }; -#define ZANSHIN_CONTEXT ZanshinContext context -#define Given(a) QVERIFY(context.a) -#define When(a) QVERIFY(context.a) -#define Then(a) QVERIFY(context.a) -#define And(a) QVERIFY(context.a) +#define Given(a) QVERIFY(a) +#define When(a) QVERIFY(a) +#define Then(a) QVERIFY(a) +#define And(a) QVERIFY(a) class ZanshinContext : public QObject { diff --git a/tests/features/contexts/contextaddfeature.cpp b/tests/features/contexts/contextaddfeature.cpp --- a/tests/features/contexts/contextaddfeature.cpp +++ b/tests/features/contexts/contextaddfeature.cpp @@ -37,11 +37,11 @@ private slots: void New_contexts_appear_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_add_a_context("Internet")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_add_a_context("Internet")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/contexts/contextdisplayfeature.cpp b/tests/features/contexts/contextdisplayfeature.cpp --- a/tests/features/contexts/contextdisplayfeature.cpp +++ b/tests/features/contexts/contextdisplayfeature.cpp @@ -37,11 +37,11 @@ private slots: void Context_tasks_appear_in_the_corresponding_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Contexts / Errands")); - And(I_look_at_the_central_list()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Contexts / Errands")); + And(c.I_look_at_the_central_list()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Buy kiwis" }, diff --git a/tests/features/contexts/contextdraganddropfeature.cpp b/tests/features/contexts/contextdraganddropfeature.cpp --- a/tests/features/contexts/contextdraganddropfeature.cpp +++ b/tests/features/contexts/contextdraganddropfeature.cpp @@ -37,14 +37,14 @@ private slots: void Dropping_a_task_on_a_context_from_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy rutabagas")); - When(I_drop_the_item_on_the_page_list("Contexts / Errands")); - And(I_display_the_page("Contexts / Errands")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy rutabagas")); + When(c.I_drop_the_item_on_the_page_list("Contexts / Errands")); + And(c.I_display_the_page("Contexts / Errands")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Buy kiwis" }, @@ -55,14 +55,14 @@ void Dropping_a_task_on_a_context_from_the_project_central_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); - And(there_is_an_item_in_the_central_list("Create examples and exercices")); - When(I_drop_the_item_on_the_page_list("Contexts / Online")); - And(I_display_the_page("Contexts / Online")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); + And(c.there_is_an_item_in_the_central_list("Create examples and exercices")); + When(c.I_drop_the_item_on_the_page_list("Contexts / Online")); + And(c.I_display_the_page("Contexts / Online")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Create examples and exercices" }, diff --git a/tests/features/contexts/contexteditfeature.cpp b/tests/features/contexts/contexteditfeature.cpp --- a/tests/features/contexts/contexteditfeature.cpp +++ b/tests/features/contexts/contexteditfeature.cpp @@ -37,11 +37,11 @@ private slots: void Renamed_context_appear_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_rename_a_page("Contexts", "Errands", "Chores")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_rename_a_page("Contexts", "Errands", "Chores")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/contexts/contextremovefeature.cpp b/tests/features/contexts/contextremovefeature.cpp --- a/tests/features/contexts/contextremovefeature.cpp +++ b/tests/features/contexts/contextremovefeature.cpp @@ -37,11 +37,11 @@ private slots: void Removed_context_disappear_from_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_remove_a_page("Contexts", "Online")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_remove_a_page("Contexts", "Online")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/contexts/contexttaskaddfeature.cpp b/tests/features/contexts/contexttaskaddfeature.cpp --- a/tests/features/contexts/contexttaskaddfeature.cpp +++ b/tests/features/contexts/contexttaskaddfeature.cpp @@ -37,12 +37,12 @@ private slots: void Task_added_from_a_context_appear_in_its_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Contexts / Online")); - When(I_add_a_task("Checking mail")); - And(I_look_at_the_central_list()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Contexts / Online")); + When(c.I_add_a_task("Checking mail")); + And(c.I_look_at_the_central_list()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Checking mail" }, diff --git a/tests/features/contexts/contexttaskremovefeature.cpp b/tests/features/contexts/contexttaskremovefeature.cpp --- a/tests/features/contexts/contexttaskremovefeature.cpp +++ b/tests/features/contexts/contexttaskremovefeature.cpp @@ -37,36 +37,36 @@ private slots: void Removing_a_task_from_a_context_keeps_it_in_the_project_page_it_s_linked_to() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); - And(there_is_an_item_in_the_central_list("Create examples and exercices")); - And(I_drop_the_item_on_the_page_list("Contexts / Online")); - And(I_display_the_page("Contexts / Online")); - And(there_is_an_item_in_the_central_list("Create examples and exercices")); - When(I_remove_the_item()); - And(I_look_at_the_central_list()); - Then(the_list_does_not_contain("Create examples and exercices")); - And(I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); - Then(there_is_an_item_in_the_central_list("Create examples and exercices")); + ZanshinContext c; + Given(c.I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); + And(c.there_is_an_item_in_the_central_list("Create examples and exercices")); + And(c.I_drop_the_item_on_the_page_list("Contexts / Online")); + And(c.I_display_the_page("Contexts / Online")); + And(c.there_is_an_item_in_the_central_list("Create examples and exercices")); + When(c.I_remove_the_item()); + And(c.I_look_at_the_central_list()); + Then(c.the_list_does_not_contain("Create examples and exercices")); + And(c.I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); + Then(c.there_is_an_item_in_the_central_list("Create examples and exercices")); } void Removing_a_task_linked_only_to_a_context_moves_it_back_to_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_look_at_the_central_list()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_look_at_the_central_list()); + Then(c.the_list_is({ { "display" }, { } })); - And(I_display_the_page("Contexts / Errands")); - And(there_is_an_item_in_the_central_list("Buy kiwis")); - When(I_remove_the_item()); - And(I_look_at_the_central_list()); - Then(the_list_does_not_contain("Buy kiwis")); - And(I_display_the_page("Inbox")); - Then(there_is_an_item_in_the_central_list("Buy kiwis")); + And(c.I_display_the_page("Contexts / Errands")); + And(c.there_is_an_item_in_the_central_list("Buy kiwis")); + When(c.I_remove_the_item()); + And(c.I_look_at_the_central_list()); + Then(c.the_list_does_not_contain("Buy kiwis")); + And(c.I_display_the_page("Inbox")); + Then(c.there_is_an_item_in_the_central_list("Buy kiwis")); } }; diff --git a/tests/features/datasource/datasourcedefaultsettingsfeature.cpp b/tests/features/datasource/datasourcedefaultsettingsfeature.cpp --- a/tests/features/datasource/datasourcedefaultsettingsfeature.cpp +++ b/tests/features/datasource/datasourcedefaultsettingsfeature.cpp @@ -37,19 +37,19 @@ private slots: void Have_a_default_data_source_for_tasks_in_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_data_sources()); - When(I_change_the_setting("defaultCollection", 7)); - Then(the_default_data_source_is("TestData / Calendar1 / Calendar2")); + ZanshinContext c; + Given(c.I_display_the_available_data_sources()); + When(c.I_change_the_setting("defaultCollection", 7)); + Then(c.the_default_data_source_is("TestData / Calendar1 / Calendar2")); } void Change_the_default_data_source_for_tasks_in_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_data_sources()); - And(I_change_the_setting("defaultCollection", 42)); - When(I_change_the_default_data_source("TestData / Calendar1 / Calendar2")); - Then(the_setting_is("defaultCollection", 7)); + ZanshinContext c; + Given(c.I_display_the_available_data_sources()); + And(c.I_change_the_setting("defaultCollection", 42)); + When(c.I_change_the_default_data_source("TestData / Calendar1 / Calendar2")); + Then(c.the_setting_is("defaultCollection", 7)); } }; diff --git a/tests/features/datasource/datasourcelistingfeature.cpp b/tests/features/datasource/datasourcelistingfeature.cpp --- a/tests/features/datasource/datasourcelistingfeature.cpp +++ b/tests/features/datasource/datasourcelistingfeature.cpp @@ -37,10 +37,10 @@ private slots: void All_task_sources_appear_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_data_sources()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_data_sources()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "TestData", "folder" }, diff --git a/tests/features/datasource/datasourceselectionfeature.cpp b/tests/features/datasource/datasourceselectionfeature.cpp --- a/tests/features/datasource/datasourceselectionfeature.cpp +++ b/tests/features/datasource/datasourceselectionfeature.cpp @@ -37,13 +37,13 @@ private slots: void Unchecking_impacts_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); - When(I_uncheck_the_item()); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); + When(c.I_uncheck_the_item()); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Buy apples" }, @@ -55,13 +55,13 @@ void Checking_impacts_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); - When(I_check_the_item()); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); + When(c.I_check_the_item()); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "\"Capital in the Twenty-First Century\" by Thomas Piketty" }, @@ -78,12 +78,12 @@ void Unchecking_impacts_project_list() { - ZANSHIN_CONTEXT; - Given(there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); - When(I_uncheck_the_item()); - And(I_display_the_available_pages()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); + When(c.I_uncheck_the_item()); + And(c.I_display_the_available_pages()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Inbox" }, @@ -100,12 +100,12 @@ void Checking_impacts_project_list() { - ZANSHIN_CONTEXT; - Given(there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); - When(I_check_the_item()); - And(I_display_the_available_pages()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.there_is_an_item_in_the_available_data_sources("TestData / Calendar1")); + When(c.I_check_the_item()); + And(c.I_display_the_available_pages()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Inbox" }, diff --git a/tests/features/editing/addingtaskfeature.cpp b/tests/features/editing/addingtaskfeature.cpp --- a/tests/features/editing/addingtaskfeature.cpp +++ b/tests/features/editing/addingtaskfeature.cpp @@ -49,12 +49,12 @@ QFETCH(QString, page); QFETCH(QString, title); - ZANSHIN_CONTEXT; - Given(I_display_the_page(page)); - And(I_look_at_the_central_list()); - When(I_add_a_task(title)); - And(I_list_the_items()); - Then(the_list_contains(title)); + ZanshinContext c; + Given(c.I_display_the_page(page)); + And(c.I_look_at_the_central_list()); + When(c.I_add_a_task(title)); + And(c.I_list_the_items()); + Then(c.the_list_contains(title)); } void Adding_a_task_as_a_child_of_another_task_in_a_page_data() @@ -73,14 +73,14 @@ QFETCH(QString, parent); QFETCH(QString, title); - ZANSHIN_CONTEXT; - Given(I_display_the_page(page)); - And(I_add_a_task(parent)); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - When(I_add_a_task_child(title, parent)); - And(I_list_the_items()); - Then(the_list_contains(parent + " / " + title)); + ZanshinContext c; + Given(c.I_display_the_page(page)); + And(c.I_add_a_task(parent)); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + When(c.I_add_a_task_child(title, parent)); + And(c.I_list_the_items()); + Then(c.the_list_contains(parent + " / " + title)); } }; diff --git a/tests/features/editing/completingtaskfeature.cpp b/tests/features/editing/completingtaskfeature.cpp --- a/tests/features/editing/completingtaskfeature.cpp +++ b/tests/features/editing/completingtaskfeature.cpp @@ -37,23 +37,23 @@ private slots: void Checking_task_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy cheese")); - When(I_check_the_item()); - Then(the_task_corresponding_to_the_item_is_done()); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy cheese")); + When(c.I_check_the_item()); + Then(c.the_task_corresponding_to_the_item_is_done()); } void Checking_task_in_the_editor() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy apples")); - When(I_open_the_item_in_the_editor()); - And(I_mark_the_item_done_in_the_editor()); - And(I_open_the_item_in_the_editor_again()); - Then(the_task_corresponding_to_the_item_is_done()); - And(the_editor_shows_the_task_as_done()); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy apples")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_mark_the_item_done_in_the_editor()); + And(c.I_open_the_item_in_the_editor_again()); + Then(c.the_task_corresponding_to_the_item_is_done()); + And(c.the_editor_shows_the_task_as_done()); } }; diff --git a/tests/features/editing/editingtaskfeature.cpp b/tests/features/editing/editingtaskfeature.cpp --- a/tests/features/editing/editingtaskfeature.cpp +++ b/tests/features/editing/editingtaskfeature.cpp @@ -37,58 +37,58 @@ private slots: void Editing_a_task_text() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy cheese")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("text", "More information")); - And(I_open_the_item_in_the_editor_again()); - Then(the_editor_shows_the_field("text", "More information")); - And(the_editor_shows_the_field("title", "Buy cheese")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy cheese")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("text", "More information")); + And(c.I_open_the_item_in_the_editor_again()); + Then(c.the_editor_shows_the_field("text", "More information")); + And(c.the_editor_shows_the_field("title", "Buy cheese")); } void Editing_a_task_title_using_the_editor() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy cheese")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("title", "Borrow cheese")); - And(I_open_the_item_in_the_editor_again()); - Then(the_editor_shows_the_field("title", "Borrow cheese")); - And(there_is_an_item_in_the_central_list("Borrow cheese")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy cheese")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("title", "Borrow cheese")); + And(c.I_open_the_item_in_the_editor_again()); + Then(c.the_editor_shows_the_field("title", "Borrow cheese")); + And(c.there_is_an_item_in_the_central_list("Borrow cheese")); } void Editing_a_task_title_in_the_central_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy cheese")); - When(I_open_the_item_in_the_editor()); - And(I_rename_the_item("Buy better cheese")); - Then(the_editor_shows_the_field("title", "Buy better cheese")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy cheese")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_rename_the_item("Buy better cheese")); + Then(c.the_editor_shows_the_field("title", "Buy better cheese")); } void Editing_a_task_start_date() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy cheese")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("start date", "2014-06-20")); - And(I_open_the_item_in_the_editor_again()); - Then(the_editor_shows_the_field("start date", "2014-06-20")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy cheese")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("start date", "2014-06-20")); + And(c.I_open_the_item_in_the_editor_again()); + Then(c.the_editor_shows_the_field("start date", "2014-06-20")); } void Editing_a_task_due_date() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy cheese")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("due date", "2014-07-20")); - And(I_open_the_item_in_the_editor_again()); - Then(the_editor_shows_the_field("due date", "2014-07-20")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy cheese")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("due date", "2014-07-20")); + And(c.I_open_the_item_in_the_editor_again()); + Then(c.the_editor_shows_the_field("due date", "2014-07-20")); } }; diff --git a/tests/features/editing/removingtaskfeature.cpp b/tests/features/editing/removingtaskfeature.cpp --- a/tests/features/editing/removingtaskfeature.cpp +++ b/tests/features/editing/removingtaskfeature.cpp @@ -49,12 +49,12 @@ QFETCH(QString, page); QFETCH(QString, title); - ZANSHIN_CONTEXT; - Given(I_display_the_page(page)); - And(there_is_an_item_in_the_central_list(title)); - When(I_remove_the_item()); - And(I_list_the_items()); - Then(the_list_does_not_contain(title)); + ZanshinContext c; + Given(c.I_display_the_page(page)); + And(c.there_is_an_item_in_the_central_list(title)); + When(c.I_remove_the_item()); + And(c.I_list_the_items()); + Then(c.the_list_does_not_contain(title)); } }; diff --git a/tests/features/inbox/inboxdisplayfeature.cpp b/tests/features/inbox/inboxdisplayfeature.cpp --- a/tests/features/inbox/inboxdisplayfeature.cpp +++ b/tests/features/inbox/inboxdisplayfeature.cpp @@ -36,11 +36,11 @@ private slots: void Unorganized_tasks_appear_in_the_inbox() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_look_at_the_central_list()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_look_at_the_central_list()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, diff --git a/tests/features/inbox/inboxdraganddropfeature.cpp b/tests/features/inbox/inboxdraganddropfeature.cpp --- a/tests/features/inbox/inboxdraganddropfeature.cpp +++ b/tests/features/inbox/inboxdraganddropfeature.cpp @@ -36,12 +36,12 @@ private slots: void Dropping_a_task_on_another_one_makes_it_a_child() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy apples")); - When(I_drop_the_item_on_the_central_list("Errands")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy apples")); + When(c.I_drop_the_item_on_the_central_list("Errands")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, @@ -58,14 +58,14 @@ void Dropping_a_child_task_on_the_inbox_makes_it_top_level() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy apples")); - And(I_drop_the_item_on_the_central_list("Errands")); - And(there_is_an_item_in_the_central_list("Errands / Buy apples")); - When(I_drop_the_item_on_the_page_list("Inbox")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy apples")); + And(c.I_drop_the_item_on_the_central_list("Errands")); + And(c.there_is_an_item_in_the_central_list("Errands / Buy apples")); + When(c.I_drop_the_item_on_the_page_list("Inbox")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, @@ -82,12 +82,12 @@ void Dropping_two_tasks_on_another_one_makes_them_children() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(the_central_list_contains_items_named({"Buy apples", "Buy pears"})); - When(I_drop_items_on_the_central_list("Errands")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.the_central_list_contains_items_named({"Buy apples", "Buy pears"})); + When(c.I_drop_items_on_the_central_list("Errands")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, @@ -104,14 +104,14 @@ void Dropping_two_child_tasks_on_the_inbox_makes_them_top_level() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(the_central_list_contains_items_named({"Buy apples", "Buy pears"})); - And(I_drop_items_on_the_central_list("Errands")); - And(the_central_list_contains_items_named({"Errands / Buy apples", "Errands / Buy pears"})); - When(I_drop_items_on_the_page_list("Inbox")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.the_central_list_contains_items_named({"Buy apples", "Buy pears"})); + And(c.I_drop_items_on_the_central_list("Errands")); + And(c.the_central_list_contains_items_named({"Errands / Buy apples", "Errands / Buy pears"})); + When(c.I_drop_items_on_the_page_list("Inbox")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, @@ -128,14 +128,14 @@ void Dropping_a_task_on_the_inbox_removes_it_from_its_associated_project() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); - And(there_is_an_item_in_the_central_list("Create Sozi SVG")); - When(I_drop_the_item_on_the_page_list("Inbox")); - And(I_display_the_page("Inbox")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Projects / TestData » Calendar1 / Prepare talk about TDD")); + And(c.there_is_an_item_in_the_central_list("Create Sozi SVG")); + When(c.I_drop_the_item_on_the_page_list("Inbox")); + And(c.I_display_the_page("Inbox")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, @@ -153,16 +153,16 @@ void Deparenting_a_task_by_dropping_on_the_central_list_blank_area() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_look_at_the_central_list()); - And(there_is_an_item_in_the_central_list("Buy apples")); - And(I_drop_the_item_on_the_central_list("Errands")); - And(I_look_at_the_central_list()); - And(there_is_an_item_in_the_central_list("Errands / Buy apples")); - When(I_drop_the_item_on_the_blank_area_of_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_look_at_the_central_list()); + And(c.there_is_an_item_in_the_central_list("Buy apples")); + And(c.I_drop_the_item_on_the_central_list("Errands")); + And(c.I_look_at_the_central_list()); + And(c.there_is_an_item_in_the_central_list("Errands / Buy apples")); + When(c.I_drop_the_item_on_the_blank_area_of_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Errands" }, @@ -179,13 +179,13 @@ void Dropping_a_task_on_the_inbox_removes_it_from_all_its_contexts() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Contexts / Errands")); - And(there_is_an_item_in_the_central_list("Buy kiwis")); - When(I_drop_the_item_on_the_page_list("Inbox")); - And(I_display_the_page("Contexts / Errands")); - And(I_look_at_the_central_list()); - Then(the_list_does_not_contain("Buy kiwis")); + ZanshinContext c; + Given(c.I_display_the_page("Contexts / Errands")); + And(c.there_is_an_item_in_the_central_list("Buy kiwis")); + When(c.I_drop_the_item_on_the_page_list("Inbox")); + And(c.I_display_the_page("Contexts / Errands")); + And(c.I_look_at_the_central_list()); + Then(c.the_list_does_not_contain("Buy kiwis")); } }; diff --git a/tests/features/pages/pagesdisplayfeature.cpp b/tests/features/pages/pagesdisplayfeature.cpp --- a/tests/features/pages/pagesdisplayfeature.cpp +++ b/tests/features/pages/pagesdisplayfeature.cpp @@ -37,10 +37,10 @@ private slots: void Inbox_projects_contexts_and_tags_appear_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/projects/projectaddfeature.cpp b/tests/features/projects/projectaddfeature.cpp --- a/tests/features/projects/projectaddfeature.cpp +++ b/tests/features/projects/projectaddfeature.cpp @@ -37,11 +37,11 @@ private slots: void New_projects_appear_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_add_a_project("Birthday", "TestData / Calendar1")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_add_a_project("Birthday", "TestData / Calendar1")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/projects/projectdisplayfeature.cpp b/tests/features/projects/projectdisplayfeature.cpp --- a/tests/features/projects/projectdisplayfeature.cpp +++ b/tests/features/projects/projectdisplayfeature.cpp @@ -37,11 +37,11 @@ private slots: void Project_tasks_appear_in_the_corresponding_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Projects / TestData » Calendar1 / Read List")); - And(I_look_at_the_central_list()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Projects / TestData » Calendar1 / Read List")); + And(c.I_look_at_the_central_list()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "\"Clean Code\" by Robert C Martin" }, diff --git a/tests/features/projects/projectdraganddropfeature.cpp b/tests/features/projects/projectdraganddropfeature.cpp --- a/tests/features/projects/projectdraganddropfeature.cpp +++ b/tests/features/projects/projectdraganddropfeature.cpp @@ -37,14 +37,14 @@ private slots: void Dropping_a_task_on_a_project() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("\"The Pragmatic Programmer\" by Hunt and Thomas")); - When(I_drop_the_item_on_the_page_list("Projects / TestData » Calendar1 / Read List")); - And(I_display_the_page("Projects / TestData » Calendar1 / Read List")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("\"The Pragmatic Programmer\" by Hunt and Thomas")); + When(c.I_drop_the_item_on_the_page_list("Projects / TestData » Calendar1 / Read List")); + And(c.I_display_the_page("Projects / TestData » Calendar1 / Read List")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "\"Clean Code\" by Robert C Martin" }, @@ -56,14 +56,14 @@ void Dropping_a_task_on_a_project_from_context_central_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Contexts / Errands")); - And(there_is_an_item_in_the_central_list("Buy kiwis")); - When(I_drop_the_item_on_the_page_list("Projects / TestData » Calendar1 » Calendar2 / Backlog")); - And(I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Contexts / Errands")); + And(c.there_is_an_item_in_the_central_list("Buy kiwis")); + When(c.I_drop_the_item_on_the_page_list("Projects / TestData » Calendar1 » Calendar2 / Backlog")); + And(c.I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Buy kiwis" }, diff --git a/tests/features/projects/projecteditfeature.cpp b/tests/features/projects/projecteditfeature.cpp --- a/tests/features/projects/projecteditfeature.cpp +++ b/tests/features/projects/projecteditfeature.cpp @@ -37,11 +37,11 @@ private slots: void Renamed_projects_appear_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_rename_a_page("Projects / TestData » Calendar1 » Calendar2", "Backlog", "Party")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_rename_a_page("Projects / TestData » Calendar1 » Calendar2", "Backlog", "Party")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/projects/projectremovefeature.cpp b/tests/features/projects/projectremovefeature.cpp --- a/tests/features/projects/projectremovefeature.cpp +++ b/tests/features/projects/projectremovefeature.cpp @@ -37,11 +37,11 @@ private slots: void Removing_a_simple_project_from_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_available_pages()); - When(I_remove_a_page("Projects / TestData » Calendar1", "Prepare talk about TDD")); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_available_pages()); + When(c.I_remove_a_page("Projects / TestData » Calendar1", "Prepare talk about TDD")); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/projects/projecttaskaddfeature.cpp b/tests/features/projects/projecttaskaddfeature.cpp --- a/tests/features/projects/projecttaskaddfeature.cpp +++ b/tests/features/projects/projecttaskaddfeature.cpp @@ -37,13 +37,13 @@ private slots: void Task_added_from_a_project_appear_in_its_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog")); - When(I_add_a_task("Buy a cake")); - And(I_add_a_task("Buy a present")); - And(I_look_at_the_central_list()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog")); + When(c.I_add_a_task("Buy a cake")); + And(c.I_add_a_task("Buy a present")); + And(c.I_look_at_the_central_list()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "Buy a cake" }, diff --git a/tests/features/projects/projecttaskpromotefeature.cpp b/tests/features/projects/projecttaskpromotefeature.cpp --- a/tests/features/projects/projecttaskpromotefeature.cpp +++ b/tests/features/projects/projecttaskpromotefeature.cpp @@ -37,15 +37,15 @@ private slots: void Task_promoted_into_a_project_appears_in_the_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog")); - And(I_add_a_task("Design a present")); - And(I_look_at_the_central_list()); - And(there_is_an_item_in_the_central_list("Design a present")); - When(I_promote_the_item()); - And(I_display_the_available_pages()); - And(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Projects / TestData » Calendar1 » Calendar2 / Backlog")); + And(c.I_add_a_task("Design a present")); + And(c.I_look_at_the_central_list()); + And(c.there_is_an_item_in_the_central_list("Design a present")); + When(c.I_promote_the_item()); + And(c.I_display_the_available_pages()); + And(c.I_list_the_items()); + Then(c.the_list_is({ { "display", "icon" }, { { "Inbox", "mail-folder-inbox" }, diff --git a/tests/features/workday/workdaydisplaycompletedfeature.cpp b/tests/features/workday/workdaydisplaycompletedfeature.cpp --- a/tests/features/workday/workdaydisplaycompletedfeature.cpp +++ b/tests/features/workday/workdaydisplaycompletedfeature.cpp @@ -37,14 +37,14 @@ private slots: void The_tasks_that_have_been_done_today_appear_in_the_Workday_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy rutabagas")); - When(I_check_the_item()); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Buy rutabagas")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy rutabagas")); + When(c.I_check_the_item()); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Buy rutabagas")); } }; diff --git a/tests/features/workday/workdaydisplayfeature.cpp b/tests/features/workday/workdaydisplayfeature.cpp --- a/tests/features/workday/workdaydisplayfeature.cpp +++ b/tests/features/workday/workdaydisplayfeature.cpp @@ -37,11 +37,11 @@ private slots: void The_tasks_that_need_to_be_done_today_appear_in_the_Workday_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - When(I_list_the_items()); - Then(the_list_is({ + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + When(c.I_list_the_items()); + Then(c.the_list_is({ { "display" }, { { "\"Clean Code\" by Robert C Martin" }, diff --git a/tests/features/workday/workdaydraganddropfeature.cpp b/tests/features/workday/workdaydraganddropfeature.cpp --- a/tests/features/workday/workdaydraganddropfeature.cpp +++ b/tests/features/workday/workdaydraganddropfeature.cpp @@ -37,34 +37,34 @@ private slots: void Parenting_a_task_in_the_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(I_add_a_task("parent")); - And(I_add_a_task("child")); - And(there_is_an_item_in_the_central_list("parent")); - And(there_is_an_item_in_the_central_list("child")); - When(I_drop_the_item_on_the_central_list("parent")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_central_list_contains_items_named({ + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.I_add_a_task("parent")); + And(c.I_add_a_task("child")); + And(c.there_is_an_item_in_the_central_list("parent")); + And(c.there_is_an_item_in_the_central_list("child")); + When(c.I_drop_the_item_on_the_central_list("parent")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_central_list_contains_items_named({ "parent", "parent / child", })); } void Deparenting_a_task_in_the_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(I_add_a_task("parent")); - And(there_is_an_item_in_the_central_list("parent")); - And(I_add_a_task_child("child", "parent")); - And(there_is_an_item_in_the_central_list("parent / child")); - When(I_drop_the_item_on_the_blank_area_of_the_central_list()); - And(I_look_at_the_central_list()); - And(I_list_the_items()); + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.I_add_a_task("parent")); + And(c.there_is_an_item_in_the_central_list("parent")); + And(c.I_add_a_task_child("child", "parent")); + And(c.there_is_an_item_in_the_central_list("parent / child")); + When(c.I_drop_the_item_on_the_blank_area_of_the_central_list()); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); QEXPECT_FAIL("", "Setting the date during deparenting is broken, see the TODO in workdaypagemodel.cpp", Continue); - Then(the_central_list_contains_items_named({ + Then(c.the_central_list_contains_items_named({ "parent", "child", })); diff --git a/tests/features/workday/workdaydropfeature.cpp b/tests/features/workday/workdaydropfeature.cpp --- a/tests/features/workday/workdaydropfeature.cpp +++ b/tests/features/workday/workdaydropfeature.cpp @@ -37,33 +37,33 @@ private slots: void Dropping_a_task_on_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_add_a_task("Buy Pineapples")); - And(there_is_an_item_in_the_central_list("Buy Pineapples")); - When(I_drop_the_item_on_the_page_list("Workday")); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Buy Pineapples")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_add_a_task("Buy Pineapples")); + And(c.there_is_an_item_in_the_central_list("Buy Pineapples")); + When(c.I_drop_the_item_on_the_page_list("Workday")); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Buy Pineapples")); } void Dropping_two_tasks_on_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_add_a_task("Don't eat the cake")); - And(I_add_a_task("The cake is a lie")); - And(the_central_list_contains_items_named({ + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_add_a_task("Don't eat the cake")); + And(c.I_add_a_task("The cake is a lie")); + And(c.the_central_list_contains_items_named({ "Don't eat the cake", "The cake is a lie", })); - When(I_drop_items_on_the_page_list("Workday")); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Don't eat the cake")); - And(the_list_contains("The cake is a lie")); + When(c.I_drop_items_on_the_page_list("Workday")); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Don't eat the cake")); + And(c.the_list_contains("The cake is a lie")); } }; diff --git a/tests/features/workday/workdayduedateeditfeature.cpp b/tests/features/workday/workdayduedateeditfeature.cpp --- a/tests/features/workday/workdayduedateeditfeature.cpp +++ b/tests/features/workday/workdayduedateeditfeature.cpp @@ -37,30 +37,30 @@ private slots: void Setting_a_date_s_due_date_to_today_makes_it_appear_in_the_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_add_a_task("Make more test tasks")); - And(there_is_an_item_in_the_central_list("Make more test tasks")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("due date", "2015-03-10")); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Make more test tasks")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_add_a_task("Make more test tasks")); + And(c.there_is_an_item_in_the_central_list("Make more test tasks")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("due date", "2015-03-10")); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Make more test tasks")); } void Setting_a_date_s_due_date_to_a_date_in_the_past_makes_it_appear_in_the_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(I_add_a_task("Buy potatoes")); - And(there_is_an_item_in_the_central_list("Buy potatoes")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("due date", "2001-03-10")); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Buy potatoes")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.I_add_a_task("Buy potatoes")); + And(c.there_is_an_item_in_the_central_list("Buy potatoes")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("due date", "2001-03-10")); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Buy potatoes")); } }; diff --git a/tests/features/workday/workdaypostponingfeature.cpp b/tests/features/workday/workdaypostponingfeature.cpp --- a/tests/features/workday/workdaypostponingfeature.cpp +++ b/tests/features/workday/workdaypostponingfeature.cpp @@ -37,26 +37,26 @@ private slots: void Setting_a_date_s_start_date_to_a_date_in_the_future_makes_it_disappear_in_the_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(there_is_an_item_in_the_central_list("Errands")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("start date", "2015-03-20")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_does_not_contain("Errands")); + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.there_is_an_item_in_the_central_list("Errands")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("start date", "2015-03-20")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_does_not_contain("Errands")); } void Setting_a_date_s_due_date_to_a_date_in_the_future_makes_it_disappear_in_the_Workday_page() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(there_is_an_item_in_the_central_list("Buy kiwis")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("due date", "2015-03-20")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_does_not_contain("Buy kiwis")); + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.there_is_an_item_in_the_central_list("Buy kiwis")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("due date", "2015-03-20")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_does_not_contain("Buy kiwis")); } }; diff --git a/tests/features/workday/workdaystartdateeditfeature.cpp b/tests/features/workday/workdaystartdateeditfeature.cpp --- a/tests/features/workday/workdaystartdateeditfeature.cpp +++ b/tests/features/workday/workdaystartdateeditfeature.cpp @@ -37,32 +37,32 @@ private slots: void Setting_a_date_s_start_date_to_today_makes_it_appear_in_the_workday_view() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy rutabagas")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("start date", "2015-03-10")); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Buy rutabagas")); + ZanshinContext c; + Given(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy rutabagas")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("start date", "2015-03-10")); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Buy rutabagas")); } void Setting_a_date_s_start_date_to_a_date_in_the_past_makes_it_appear_in_the_workday_view() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - And(the_list_does_not_contain("Buy rutabagas")); - And(I_display_the_page("Inbox")); - And(there_is_an_item_in_the_central_list("Buy rutabagas")); - When(I_open_the_item_in_the_editor()); - And(I_change_the_editor_field("start date", "2014-03-10")); - And(I_display_the_page("Workday")); - And(I_look_at_the_central_list()); - And(I_list_the_items()); - Then(the_list_contains("Buy rutabagas")); + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + And(c.the_list_does_not_contain("Buy rutabagas")); + And(c.I_display_the_page("Inbox")); + And(c.there_is_an_item_in_the_central_list("Buy rutabagas")); + When(c.I_open_the_item_in_the_editor()); + And(c.I_change_the_editor_field("start date", "2014-03-10")); + And(c.I_display_the_page("Workday")); + And(c.I_look_at_the_central_list()); + And(c.I_list_the_items()); + Then(c.the_list_contains("Buy rutabagas")); } }; diff --git a/tests/features/workday/workdaytaskaddfeature.cpp b/tests/features/workday/workdaytaskaddfeature.cpp --- a/tests/features/workday/workdaytaskaddfeature.cpp +++ b/tests/features/workday/workdaytaskaddfeature.cpp @@ -37,12 +37,12 @@ private slots: void Tasks_added_from_the_workday_view_start_today() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - When(I_look_at_the_central_list()); - And(I_add_a_task("Burn some confidential documents")); - And(I_list_the_items()); - Then(the_list_contains("Burn some confidential documents")); + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + When(c.I_look_at_the_central_list()); + And(c.I_add_a_task("Burn some confidential documents")); + And(c.I_list_the_items()); + Then(c.the_list_contains("Burn some confidential documents")); } }; diff --git a/tests/features/workday/workdaytaskremovefeature.cpp b/tests/features/workday/workdaytaskremovefeature.cpp --- a/tests/features/workday/workdaytaskremovefeature.cpp +++ b/tests/features/workday/workdaytaskremovefeature.cpp @@ -37,12 +37,12 @@ private slots: void Removing_a_task_that_appear_in_the_Workday_list() { - ZANSHIN_CONTEXT; - Given(I_display_the_page("Workday")); - And(there_is_an_item_in_the_central_list("Buy pears")); - When(I_remove_the_item()); - And(I_list_the_items()); - Then(the_list_does_not_contain("Buy pears")); + ZanshinContext c; + Given(c.I_display_the_page("Workday")); + And(c.there_is_an_item_in_the_central_list("Buy pears")); + When(c.I_remove_the_item()); + And(c.I_list_the_items()); + Then(c.the_list_does_not_contain("Buy pears")); } };