diff options
Diffstat (limited to 'spec/support/fixture_file_helper.rb')
| -rw-r--r-- | spec/support/fixture_file_helper.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/support/fixture_file_helper.rb b/spec/support/fixture_file_helper.rb index fe11acd..5a9599f 100644 --- a/spec/support/fixture_file_helper.rb +++ b/spec/support/fixture_file_helper.rb @@ -1,6 +1,11 @@ module FixtureFileHelper - def fixture_file_content(path) - IO.read(fixture_file(path)) + def fixture_file_content(path, data = {}) + content = IO.read(fixture_file(path)) + return content unless path.end_with?('.erb') + + ERB + .new(content) + .result(OpenStruct.new(data).send(:binding)) end def fixture_file(path) |
