Sha256: 280fd24840d122af46a18308cc1b7251824d6a296a6fafc49a4dea379dc4d277

Contents?: true

Size: 825 Bytes

Versions: 3

Compression:

Stored size: 825 Bytes

Contents

require 'rubygems'
gem 'rspec'
require 'spec'
require 'stringio'

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

Spec::Runner.configure do |config|
  config.prepend_before do
    SdocAll::Base.stub!(:system)
    SdocAll::Base.stub!(:remove_if_present)
    class <<Dir
      alias original_chdir chdir
    end
    Dir.stub!(:chdir).and_yield
    Net::FTP.stub!(:open)
    File.stub!(:symlink)
    @progress_io = StringIO.new
    Progress.stub!(:io).and_return(@progress_io)

    SdocAll.constants.each do |constant|
      klass = SdocAll.const_get(constant)
      if klass.is_a?(Class) && klass.superclass == SdocAll::Base
        klass.stub!(:sources_path).and_return(Pathname.new("sources/#{constant.downcase}"))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sdoc_all-1.0.7 spec/spec_helper.rb
sdoc_all-1.0.6 spec/spec_helper.rb
sdoc_all-1.0.5 spec/spec_helper.rb