Fix syntax for ruby compatibility

This commit is contained in:
Matthew Mongeau 2011-09-30 11:41:59 -04:00
parent fb119f6ff8
commit 89bee3cf65
2 changed files with 2 additions and 5 deletions

View File

@ -95,9 +95,7 @@ class Capybara::Driver::Webkit
end end
def get_cookies def get_cookies
command("GetCookies").lines command("GetCookies").lines.map{ |line| line.strip }.select{ |line| !line.empty? }
.map { |line| line.strip }
.select { |line| !line.empty? }
end end
private private

View File

@ -931,8 +931,7 @@ describe Capybara::Driver::Webkit do
cookies.size.should == 1 cookies.size.should == 1
cookie = Hash[cookies[0].split(/\s*;\s*/) cookie = Hash[cookies[0].split(/\s*;\s*/).map { |x| x.split("=", 2) }]
.map { |x| x.split("=", 2) }]
cookie["cookie"].should == "abc" cookie["cookie"].should == "abc"
cookie["domain"].should include "127.0.0.1" cookie["domain"].should include "127.0.0.1"
cookie["path"].should == "/" cookie["path"].should == "/"