Sha256: af33ae8a9d7a9569a3d3b268724ade4ee83413b63fc67adf4dfbc72030a520f4

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'tempfile'
require 'ostruct'

require 'hashie'
require 'rspec'
require 'fakefs/safe'
require 'mocha'
require 'bio'
require 'scaffolder/test/helpers'
require 'scaffolder'

require 'scaffolder/tool'
require 'scaffolder/tool_index'
require 'scaffolder/binary_helper'
Dir["#{File.dirname(__FILE__)}/../lib/scaffolder/tool/*.rb"].each do |f|
  require File.expand_path(f)
end

Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each do |f|
  require File.expand_path(f)
end

RSpec.configure do |config|
  config.mock_with :mocha

  include Scaffolder::Test::Helpers

  def tool_subclasses
    ObjectSpace.each_object.map{|obj| obj.class }.select do |cls|
      cls.superclass == Scaffolder::Tool
    end
  end

  def mock_command_line_settings(scaf_file = mock, seq_file = mock, hash_args={})
    settings = mock

    settings.stubs(:rest).returns([scaf_file,seq_file])
    settings.stubs(:sequence_file).returns(seq_file)
    settings.stubs(:scaffold_file).returns(scaf_file)

    hash_args.each do |key,value|
      settings.expects(:[]).with(key).returns(value)
    end

    settings
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scaffolder-tools-0.1.2 spec/spec_helper.rb
scaffolder-tools-0.1.1 spec/spec_helper.rb
scaffolder-tools-0.1.0 spec/spec_helper.rb