From 167fda60e7c317928a62f3f0bd22dc2cc034454f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20W=20Mittag?= Date: Thu, 26 Mar 2009 15:33:09 +0100 Subject: [PATCH] Split Features into Parser and TextFormatter. Multiple Features per feature file are illegal in Cucumber. --- akkordarbeit.gemspec | 3 +- features/parser.feature | 63 +++++++++++++++++++++ ...akkordarbeit.feature => text_formatter.feature} | 65 ---------------------- 3 files changed, 65 insertions(+), 66 deletions(-) create mode 100644 features/parser.feature rename features/{akkordarbeit.feature => text_formatter.feature} (53%) diff --git a/akkordarbeit.gemspec b/akkordarbeit.gemspec index 4b4a0ff..a07b181 100644 --- a/akkordarbeit.gemspec +++ b/akkordarbeit.gemspec @@ -20,7 +20,8 @@ or plaintext. FEATUREDIR = 'features' FEATURES = %w[ - akkordarbeit.feature + parser.feature + text_formatter.feature step_definitions/akkordarbeit_steps.rb ] FEATUREFILES = FEATURES.map { |f| File.join FEATUREDIR, f } diff --git a/features/parser.feature b/features/parser.feature new file mode 100644 index 0000000..10f857e --- /dev/null +++ b/features/parser.feature @@ -0,0 +1,63 @@ +Feature: Parsing + In order to seperate backend and frontend + As a backend writer + I want to get a parsetree + + Scenario: Simple Song + Given the song + """ + [D]Do what I say, [Em]or I will suffer + """ + + When I parse it + Then the parsetree should be + """ + [ + [ + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] + ] + ] + """ + + Scenario: Simple Song Multiline + Given the song + """ + [D]Do what I say, [Em]or I will suffer + [D]Do what I say, [Em]or I will suffer + """ + + When I parse it + Then the parsetree should be + """ + [ + [ + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'], + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] + ] + ] + """ + + Scenario: Song with two sections + Given the song + """ + [D]Do what I say, [Em]or I will suffer + [D]Do what I say, [Em]or I will suffer + + [D]Do what I say, [Em]or I will suffer + [D]Do what I say, [Em]or I will suffer + """ + + When I parse it + Then the parsetree should be + """ + [ + [ + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'], + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] + ], + [ + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'], + ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] + ] + ] + """ diff --git a/features/akkordarbeit.feature b/features/text_formatter.feature similarity index 53% rename from features/akkordarbeit.feature rename to features/text_formatter.feature index 97c5220..fc4f5a8 100644 --- a/features/akkordarbeit.feature +++ b/features/text_formatter.feature @@ -1,73 +1,8 @@ -Feature: Parsing - In order to seperate backend and frontend - As a backend writer - I want to get a parsetree - - Scenario: Simple Song - Given the song - """ - [D]Do what I say, [Em]or I will suffer - """ - - When I parse it - Then the parsetree should be - """ - [ - [ - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] - ] - ] - """ - - Scenario: Simple Song Multiline - Given the song - """ - [D]Do what I say, [Em]or I will suffer - [D]Do what I say, [Em]or I will suffer - """ - - When I parse it - Then the parsetree should be - """ - [ - [ - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'], - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] - ] - ] - """ - - Scenario: Song with two sections - Given the song - """ - [D]Do what I say, [Em]or I will suffer - [D]Do what I say, [Em]or I will suffer - - [D]Do what I say, [Em]or I will suffer - [D]Do what I say, [Em]or I will suffer - """ - - When I parse it - Then the parsetree should be - """ - [ - [ - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'], - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] - ], - [ - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'], - ['[D]', 'Do what I say, ', '[Em]', 'or I will suffer'] - ] - ] - """ - Feature: Text Output In order to view the chord files As a user I want to get a text output - Scenario: Text Output of a simple Song Given the parsetree """ -- 2.11.4.GIT