Sha256: cc453cd641ecef86e71d43387db293ce3828928f7c162a08790560e588e353c4

Contents?: true

Size: 748 Bytes

Versions: 33

Compression:

Stored size: 748 Bytes

Contents

def mock_yaml(hash, path)
  mock_file = mock(path.split("/")[-1])
  File.stubs(:exist?).with(path).returns(true)
  File.expects(:open).with(path).returns(mock_file)
  YAML.expects(:load).returns(hash)
end

def default_predicate_mapping_file
  File.expand_path(File.join(File.dirname(__FILE__),"..","config","predicate_mappings.yml"))
end

def stub_rails(opts={})
  Object.const_set("Rails",Class)
  Rails.send(:undef_method,:env) if Rails.respond_to?(:env)
  Rails.send(:undef_method,:root) if Rails.respond_to?(:root)
  opts.each { |k,v| Rails.send(:define_method,k){ return v } }
end

def unstub_rails
  Object.send(:remove_const,:Rails) if defined?(Rails)
end
    
def setup_pretest_env
  ENV['RAILS_ENV']='test'
  ENV['environment']='test'
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
active-fedora-5.1.0 spec/config_helper.rb
active-fedora-5.0.0 spec/config_helper.rb
active-fedora-5.0.0.rc5 spec/config_helper.rb
active-fedora-5.0.0.rc4 spec/config_helper.rb
active-fedora-5.0.0.rc3 spec/config_helper.rb
active-fedora-5.0.0.rc2 spec/config_helper.rb
active-fedora-5.0.0.rc1 spec/config_helper.rb
active-fedora-4.6.0.rc4 spec/config_helper.rb
active-fedora-4.6.0.rc3 spec/config_helper.rb
active-fedora-4.6.0.rc2 spec/config_helper.rb
active-fedora-4.6.0.rc1 spec/config_helper.rb
active-fedora-4.5.3 spec/config_helper.rb
active-fedora-4.5.2 spec/config_helper.rb
active-fedora-4.5.1 spec/config_helper.rb
active-fedora-4.5.0 spec/config_helper.rb
active-fedora-4.4.1 spec/config_helper.rb
active-fedora-4.4.0 spec/config_helper.rb
active-fedora-4.3.0 spec/config_helper.rb
active-fedora-4.2.0 spec/config_helper.rb
active-fedora-4.1.0 spec/config_helper.rb