Sha256: 81b5ee6ecf87edc5f94df3959d1da17f648ef80fd0485dd55ca5ea709294a4b9

Contents?: true

Size: 768 Bytes

Versions: 1

Compression:

Stored size: 768 Bytes

Contents

require 'vips8'

require 'tempfile'

module Spec

    module Path
        def root
            @root ||= Pathname.new(File.expand_path('..', __FILE__))
        end

        def sample(*path)
            root.join 'samples', *path
        end

        def tmp(*path)
            root.join 'tmp', 'working', *path
        end

        extend self

    end

    module Helpers
        def reset_working!
            FileUtils.rm Dir[tmp.join('*.*')]
            FileUtils.mkdir_p(tmp)
        end
    end

end

def simg(name)
    Spec::Path::sample(name).to_s
end

def timg(name)
    Spec::Path::tmp(name).to_s
end

RSpec.configure do |config|
    config.include Spec::Path
    config.include Spec::Helpers

    config.before :each do
        reset_working!
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-vips8-0.1.0 spec/spec_helper.rb