aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/load_file_fixtures.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-05-28 15:14:44 +0100
committerLouise Crow <louise.crow@gmail.com>2013-05-28 15:14:44 +0100
commitef682f7d7c3402713efea88775b246c3c7960aa2 (patch)
treee4918a75cf1a24eecaab287602cf561245b611fc /spec/support/load_file_fixtures.rb
parent988becbb62e42feb9b62af27cdb2ec67b409032a (diff)
parentc248356a8e8a13513827381977b24f7406f96a8c (diff)
Merge branch 'rails-3-develop' of ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
Conflicts: Gemfile.lock
Diffstat (limited to 'spec/support/load_file_fixtures.rb')
-rw-r--r--spec/support/load_file_fixtures.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/spec/support/load_file_fixtures.rb b/spec/support/load_file_fixtures.rb
index 08079f654..a54505e99 100644
--- a/spec/support/load_file_fixtures.rb
+++ b/spec/support/load_file_fixtures.rb
@@ -2,13 +2,7 @@ def file_fixture_name(file_name)
return File.join(RSpec.configuration.fixture_path, "files", file_name)
end
-def load_file_fixture(file_name, as_binary=false)
+def load_file_fixture(file_name)
file_name = file_fixture_name(file_name)
- content = File.open(file_name, 'r') do |file|
- if as_binary
- file.set_encoding(Encoding::BINARY) if file.respond_to?(:set_encoding)
- end
- file.read
- end
- return content
+ return File.open(file_name, 'rb') { |f| f.read }
end