$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'sugar_png' # 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