spec/spec_helper.rb in sugar_png-0.0.0 vs spec/spec_helper.rb in sugar_png-0.0.1

- old
+ new

@@ -5,8 +5,20 @@ # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} +module ResourceFileHelper + def resource_file(name) + File.expand_path("./resources/#{name}", File.dirname(__FILE__)) + end + + def resource_data(name) + data = nil + File.open(resource_file(name), 'rb') { |f| data = f.read } + data + end +end + RSpec.configure do |config| - + config.include ResourceFileHelper end