From d6ae5d9446ff50554ab72659d3a4e489547ed556 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 14 Apr 2015 00:37:46 +0000 Subject: [PATCH] Add rspec helpers for filesystem --- spec/support/filesystem_helpers.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spec/support/filesystem_helpers.rb diff --git a/spec/support/filesystem_helpers.rb b/spec/support/filesystem_helpers.rb new file mode 100644 index 0000000..8aa32d0 --- /dev/null +++ b/spec/support/filesystem_helpers.rb @@ -0,0 +1,11 @@ +require 'tempfile' + +module FileSystemHelpers + def with_file content + Tempfile.create('uhwm_rspec') do |f| + f.write content + f.rewind + yield f + end + end +end