spec/spec_helper.rb in grim-0.2.1 vs spec/spec_helper.rb in grim-0.2.2

- old
+ new

@@ -1,12 +1,17 @@ # encoding: UTF-8 +require 'benchmark' require 'rubygems' require 'bundler/setup' require 'grim' -RSpec.configure do |config| +module FileHelpers + def dimensions_for_path(path) + width, height = `identify -format '%wx%h' #{path}`.strip.split('x').map(&:to_f) + end + def fixture_path(name) path = File.expand_path("./spec/fixtures/") File.join(path, name) end @@ -17,6 +22,10 @@ end def tmp_path(name) File.join(tmp_dir, name) end +end + +RSpec.configure do |config| + config.include(FileHelpers) end \ No newline at end of file