aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/load_file_fixtures.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/load_file_fixtures.rb')
-rw-r--r--spec/support/load_file_fixtures.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/load_file_fixtures.rb b/spec/support/load_file_fixtures.rb
new file mode 100644
index 000000000..a54505e99
--- /dev/null
+++ b/spec/support/load_file_fixtures.rb
@@ -0,0 +1,8 @@
+def file_fixture_name(file_name)
+ return File.join(RSpec.configuration.fixture_path, "files", file_name)
+end
+
+def load_file_fixture(file_name)
+ file_name = file_fixture_name(file_name)
+ return File.open(file_name, 'rb') { |f| f.read }
+end