Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Added bundler support also for testing [Thanks to Ryanfitz]
Browse files Browse the repository at this point in the history
  • Loading branch information
DAddYE committed Jun 7, 2010
1 parent 06a7291 commit 01476f7
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.bundle
1 change: 1 addition & 0 deletions CHANGES.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

== 0.9.11 (Unreleased)

* Added bundler support also for testing [Thanks to Ryanfitz]
* Updated I18n dependency to version > 0.4.0
* Padrino now uses http_router instead of usher to handle url routing
* Reorganized a bit ours "servers"
Expand Down
24 changes: 24 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
source 'http://rubygems.org'

gem "sinatra", ">= 1.0.0"
gem "http_router", ">= 0.2.1"
gem "thor", ">= 0.13.0"
gem "activesupport", "<= 2.3.8", :require => 'active_support'
gem "shoulda", ">= 2.10.3"
gem "i18n", "0.4.1"
gem "mail", ">= 2.2.0"
gem "builder", ">= 2.1.2"

group :db do
gem "dm-core", ">= 0.10.2"
gem "dm-validations", ">= 0.10.2"
gem "dm-aggregates", ">= 0.10.2"
gem "data_objects", ">= 0.10.2"
gem "do_sqlite3", ">= 0.10.2"
end

gem "rake", ">= 0.8.7"
gem "mocha", ">= 0.9.8"
gem "rack-test", ">= 0.5.0"
gem "webrat", ">= 0.5.1"
gem "haml", ">= 2.2.22"
25 changes: 25 additions & 0 deletions load_paths.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
begin
require File.expand_path('../.bundle/environment', __FILE__)
rescue LoadError
# bust gem prelude
if defined?(Gem)
Gem.cache
gem 'bundler'
else
require 'rubygems'
end
require 'bundler'
Bundler.setup
end

%w(
padrino
padrino-admin
padrino-cache
padrino-core
padrino-gen
padrino-helpers
padrino-mailer
).each do |framework|
$:.unshift File.expand_path("../#{framework}/lib", __FILE__)
end
2 changes: 1 addition & 1 deletion padrino-admin/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ENV['PADRINO_ENV'] = 'test'
PADRINO_ROOT = File.dirname(__FILE__) unless defined? PADRINO_ROOT

require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'test/unit'
require 'rack/test'
require 'rack'
Expand Down
3 changes: 1 addition & 2 deletions padrino-cache/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'rack/test'
require 'webrat'

require 'padrino-cache'

class Test::Unit::TestCase
Expand Down
2 changes: 1 addition & 1 deletion padrino-core/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ENV['PADRINO_ENV'] = 'test'
PADRINO_ROOT = File.dirname(__FILE__) unless defined? PADRINO_ROOT

require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'padrino-core'
require 'test/unit'
require 'rack/test'
Expand Down
12 changes: 2 additions & 10 deletions padrino-gen/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'rack/test'
require 'webrat'
require 'thor/group'

# We try to load the vendored padrino-core if exist
%w(core).each do |lib|
if File.exist?(File.dirname(__FILE__) + "/../../padrino-#{lib}/lib")
$:.unshift File.dirname(__FILE__) + "/../../padrino-#{lib}/lib"
end
end

require 'padrino-gen'
require 'padrino-core/support_lite'

Expand All @@ -32,7 +24,7 @@ def stop_time_for_test
Time.stubs(:now).returns(time)
return time
end

# generate(:controller, 'DemoItems', '-r=/tmp/sample_project')
def generate(name, *params)
"Padrino::Generators::#{name.to_s.camelize}".constantize.start(params)
Expand Down
2 changes: 1 addition & 1 deletion padrino-helpers/padrino-helpers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.require_path = 'lib'
s.add_runtime_dependency(%q<padrino-core>, ["= #{Padrino.version}"])
s.add_runtime_dependency(%q<i18n>, [">= 0.4.0"])
s.add_runtime_dependency(%q<i18n>, [">= 0.4.1"])
s.add_development_dependency(%q<haml>, [">= 2.2.1"])
s.add_development_dependency(%q<shoulda>, [">= 2.10.3"])
s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
Expand Down
10 changes: 1 addition & 9 deletions padrino-helpers/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'rack/test'
require 'webrat'

# We try to load the vendored padrino-core if exist
%w(core).each do |lib|
if File.exist?(File.dirname(__FILE__) + "/../../padrino-#{lib}/lib")
$:.unshift File.dirname(__FILE__) + "/../../padrino-#{lib}/lib"
end
end

require 'padrino-helpers'

# We need some extension for do our tests
Expand Down
11 changes: 1 addition & 10 deletions padrino-mailer/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
ENV['PADRINO_ENV'] = 'test'
PADRINO_ROOT = File.dirname(__FILE__) unless defined? PADRINO_ROOT

require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'test/unit'
require 'shoulda'
require 'mocha'
require 'rack/test'
require 'sinatra/base'

# We try to load the vendored padrino-core if exist
%w(core).each do |lib|
if File.exist?(File.dirname(__FILE__) + "/../../padrino-#{lib}/lib")
$:.unshift File.dirname(__FILE__) + "/../../padrino-#{lib}/lib"
end
end

require 'padrino-core'
require 'padrino-mailer'

Expand Down
3 changes: 1 addition & 2 deletions padrino/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'rubygems'
require File.expand_path('../../../load_paths', __FILE__)
require 'test/unit'
require 'shoulda'

require 'padrino'

class Test::Unit::TestCase
Expand Down

0 comments on commit 01476f7

Please sign in to comment.