Sha256: 74c5c3fa7b6f08a8933365399245b9888e72ecc04c2e5f5f24fe10845d38c8f6

Contents?: true

Size: 759 Bytes

Versions: 31

Compression:

Stored size: 759 Bytes

Contents

def mock_yaml(hash, path)
  mock_file = double(path.split("/")[-1])
  File.stub(:exist?).with(path).and_return(true)
  File.stub(:open).with(path).and_return(mock_file)
  YAMLAdaptor.stub(:load).and_return(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

31 entries across 31 versions & 1 rubygems

Version Path
active-fedora-6.7.8 spec/config_helper.rb
active-fedora-6.7.7 spec/config_helper.rb
active-fedora-7.0.0.rc2 spec/config_helper.rb
active-fedora-6.7.6 spec/config_helper.rb
active-fedora-7.0.0.rc1 spec/config_helper.rb
active-fedora-6.7.5 spec/config_helper.rb
active-fedora-7.0.0.pre3 spec/config_helper.rb
active-fedora-6.7.4 spec/config_helper.rb
active-fedora-7.0.0.pre2 spec/config_helper.rb
active-fedora-7.0.0.pre1 spec/config_helper.rb
active-fedora-6.7.3 spec/config_helper.rb
active-fedora-6.7.2 spec/config_helper.rb
active-fedora-6.7.1 spec/config_helper.rb
active-fedora-6.7.0 spec/config_helper.rb
active-fedora-6.7.0.rc1 spec/config_helper.rb
active-fedora-6.6.1 spec/config_helper.rb
active-fedora-6.6.0 spec/config_helper.rb
active-fedora-6.6.0.rc5 spec/config_helper.rb
active-fedora-6.6.0.rc4 spec/config_helper.rb
active-fedora-6.6.0.rc3 spec/config_helper.rb