From be54303fa93025342526a522fb7322e19a7642ad Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Mon, 2 Sep 2013 14:00:58 +0200 Subject: [PATCH] Use File#read instead of #readlines.join construct --- features/step_definitions/jekyll_steps.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index a1a1b797..483e61ec 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -142,11 +142,11 @@ Then /^the (.*) directory should exist$/ do |dir| end Then /^I should see "(.*)" in "(.*)"$/ do |text, file| - assert Regexp.new(text).match(File.open(file).readlines.join) + assert Regexp.new(text).match(File.read(file)) end Then /^I should see exactly "(.*)" in "(.*)"$/ do |text, file| - assert_equal text, File.open(file).readlines.join.strip + assert_equal text, File.read(file).strip end Then /^I should not see "(.*)" in "(.*)"$/ do |text, file| @@ -154,7 +154,7 @@ Then /^I should not see "(.*)" in "(.*)"$/ do |text, file| end Then /^I should see escaped "(.*)" in "(.*)"$/ do |text, file| - assert Regexp.new(Regexp.escape(text)).match(File.open(file).readlines.join) + assert Regexp.new(Regexp.escape(text)).match(File.read(file)) end Then /^the "(.*)" file should exist$/ do |file| @@ -166,9 +166,9 @@ Then /^the "(.*)" file should not exist$/ do |file| end Then /^I should see today's time in "(.*)"$/ do |file| - assert_match Regexp.new(Regexp.escape(Time.now.to_s)), File.open(file).readlines.join + assert_match Regexp.new(Regexp.escape(Time.now.to_s)), File.read(file) end Then /^I should see today's date in "(.*)"$/ do |file| - assert_match Regexp.new(Date.today.to_s), File.open(file).readlines.join + assert_match Regexp.new(Date.today.to_s), File.read(file) end