spec/spec_helper.rb in scaffolder-tools-0.1.2 vs spec/spec_helper.rb in scaffolder-tools-0.1.3

- old
+ new

@@ -2,11 +2,10 @@ $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' @@ -24,28 +23,35 @@ end RSpec.configure do |config| config.mock_with :mocha + include Scaffolder::Test 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 + class MockSettings - settings.stubs(:rest).returns([scaf_file,seq_file]) - settings.stubs(:sequence_file).returns(seq_file) - settings.stubs(:scaffold_file).returns(scaf_file) + attr :scaf_file + attr :seq_file - hash_args.each do |key,value| - settings.expects(:[]).with(key).returns(value) + def initialize(scaf_file = nil, seq_file = nil, command_args = {}) + @scaf_file, @seq_file, = scaf_file, seq_file + @args = command_args end - settings + def rest + [scaf_file,seq_file] + end + + def [](arg) + @args[arg] + end + end end