spec/spec_helper.rb in polisher-0.4 vs spec/spec_helper.rb in polisher-0.5.1
- old
+ new
@@ -1,44 +1,57 @@
-# polisher spec system helper
+# Polisher Spec Helper
#
-# Copyright (C) 2010 Red Hat, Inc.
-# Written by Mohammed Morsi <mmorsi@redhat.com>
-#
-# This program is free software, you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License
-# as published by the Free Software Foundation, either version 3
-# of the License, or (at your option) any later version.
-#
-# You should have received a copy of the the GNU Affero
-# General Public License, along with Polisher. If not, see
-# <http://www.gnu.org/licenses/>
+# Licensed under the MIT license
+# Copyright (C) 2013 Red Hat, Inc.
-require 'rubygems'
-require 'sinatra'
-require 'rack/test'
-require 'spec'
-require 'spec/autorun'
-require 'spec/interop/test'
+SPEC_DIR = File.expand_path File.dirname(__FILE__)
-dir = File.expand_path(File.dirname(__FILE__) + '/..' )
+module Polisher
+ module Test
+ GEM_SPEC = {
+ :path => "#{SPEC_DIR}/data/mysql-2.9.1.gemspec",
+ :name => 'mysql',
+ :version => '2.9.1',
+ :deps => [],
+ :dev_deps => ['rdoc', 'rake-compiler', 'hoe']
+ }
-# set polisher conf
-set :artifacts_dir => dir + '/spec/artifacts'
-set :polisher_config => dir + '/config/polisher.yml'
-set :db_config => dir + '/config/database.yml'
-set :log_dir => dir + '/log'
-set :db_data_dir => dir + '/db/data'
+ GEM_JSON = {
+ :url => "https://rubygems.org/api/v1/gems/rails.json",
+ :json => File.read("#{SPEC_DIR}/data/rails.json"),
+ :name => 'rails',
+ :version => '4.0.1',
+ :deps => ["actionmailer", "actionpack", "activerecord", "activesupport", "bundler", "railties", "sprockets-rails"],
+ :dev_deps => []
+ }
-# set test environment
-set :environment, :test
-set :run, false
-set :raise_errors, true
-set :logging, true
-set :views, dir + '/views'
+ LOCAL_GEM = {
+ :json_url => "https://rubygems.org/api/v1/gems/rspec.json",
+ :json => File.read("#{SPEC_DIR}/data/rspec.json"),
+ :url => "https://rubygems.org/gems/rspec-2.12.0.gem",
+ :contents => File.read("#{SPEC_DIR}/data/rspec-2.12.0.gem"),
+ :name => 'rspec',
+ :version => '2.12.0',
+ :deps => ['rspec-core', 'rspec-expectations', 'rspec-mocks'],
+ :dev_deps => [],
+ :files => ['/License.txt', '/README.md', '/lib', '/lib/rspec', '/lib/rspec/version.rb', '/lib/rspec.rb']
+ }
-require File.join(File.dirname(__FILE__), '..', 'polisher')
+ GEMFILE = {
+ :path => "#{SPEC_DIR}/data/Gemfile",
+ :contents => File.read("#{SPEC_DIR}/data/Gemfile"),
+ :deps => ['rubygems', 'cinch']
+ }
-Test::Unit::TestCase.send :include, Rack::Test::Methods
-
-def app
- Sinatra::Application
-end
+ RPM_SPEC = {
+ :path => "#{SPEC_DIR}/data/rubygem-activesupport.spec",
+ :contents => File.read("#{SPEC_DIR}/data/rubygem-activesupport.spec"),
+ :name => "activesupport",
+ :version => "4.0.0",
+ :release => "1%{?dist}",
+ :requires => ["ruby(rubygems)", "ruby(release)", "rubygem(bigdecimal)", "rubygem(dalli)", "rubygem(i18n) >= 0.6", "rubygem(i18n) < 1.0", "rubygem(minitest) >= 4.2", "rubygem(minitest) < 5", "rubygem(multi_json) >= 1.0", "rubygem(multi_json) < 2", "rubygem(rack)", "rubygem(thread_safe)", "rubygem(tzinfo) >= 0.3.37", "rubygem(tzinfo) < 0.4.0"],
+ :build_requires => ["rubygems-devel", "rubygem(bigdecimal)", "rubygem(builder)", "rubygem(dalli)", "rubygem(i18n) >= 0.6", "rubygem(i18n) < 1.0", "rubygem(minitest)", "rubygem(mocha)", "rubygem(multi_json) >= 1.0", "rubygem(multi_json) < 2", "rubygem(rack)", "rubygem(thread_safe)", "rubygem(tzinfo) >= 0.3.37", "rubygem(tzinfo) < 0.4.0"],
+ :changelog => "",
+ :files => {"activesupport"=>["/CHANGELOG.md", "/lib", "/MIT-LICENSE", "/README.rdoc", "%{gem_docdir}", "%{gem_cache}", "%{gem_spec}", "/test"]}
+ }
+ end # module Test
+end # module Polisher