From 54d7ac6e33b873cab7b4697d1c9fb05539646712 Mon Sep 17 00:00:00 2001 From: John Piasetzki Date: Sat, 25 May 2013 11:45:30 -0400 Subject: [PATCH 1/2] Combined two features into one --- features/step_definitions/jekyll_steps.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 696ddcb8..ec780d8b 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -31,14 +31,13 @@ Given /^I have an? "(.*)" file that contains "(.*)"$/ do |file, text| end end -Given /^I have a (.*) layout that contains "(.*)"$/ do |layout, text| - File.open(File.join('_layouts', layout + '.html'), 'w') do |f| - f.write(text) +Given /^I have an? (.*) (layout|theme) that contains "([^"]+)"$/ do |name, type, text| + folder = if (type == 'layout') + '_layouts' + else + '_theme' end -end - -Given /^I have a (.*) theme that contains "(.*)"$/ do |layout, text| - File.open(File.join('_theme', layout + '.html'), 'w') do |f| + File.open(File.join(folder, name + '.html'), 'w') do |f| f.write(text) end end From 240bcccd2f705a1a37c6fa4bb12380b4499f8d7a Mon Sep 17 00:00:00 2001 From: John Piasetzki Date: Sat, 25 May 2013 16:32:36 -0400 Subject: [PATCH 2/2] Remove extra parentheses and swapped regex back --- features/step_definitions/jekyll_steps.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index ec780d8b..3ca8088b 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -31,8 +31,8 @@ Given /^I have an? "(.*)" file that contains "(.*)"$/ do |file, text| end end -Given /^I have an? (.*) (layout|theme) that contains "([^"]+)"$/ do |name, type, text| - folder = if (type == 'layout') +Given /^I have an? (.*) (layout|theme) that contains "(.*)"$/ do |name, type, text| + folder = if type == 'layout' '_layouts' else '_theme'