Skip to content

Commit

Permalink
Adding TestUnit integration.
Browse files Browse the repository at this point in the history
This should make sure everything works well with T::U.

Fixes #354.
  • Loading branch information
steveklabnik committed Nov 30, 2012
1 parent bb55ba5 commit 087e134
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/draper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
require 'draper/railtie' if defined?(Rails)

# Test Support
require 'draper/test/rspec_integration' if defined?(RSpec) and RSpec.respond_to?(:configure)
require 'draper/test/minitest_integration' if defined?(MiniTest::Rails)
require 'draper/test/rspec_integration' if defined?(RSpec) and RSpec.respond_to?(:configure)
require 'draper/test/minitest_integration' if defined?(MiniTest::Rails)
require 'draper/test/test_unit_integration'

module Draper
def self.setup_action_controller(base)
Expand Down
3 changes: 3 additions & 0 deletions lib/draper/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ class Railtie < Rails::Railtie
Draper::ViewContext.build_view_context
end

rake_tasks do
Dir[File.join(File.dirname(__FILE__),'tasks/*.rake')].each { |f| load f }
end
end
end
3 changes: 3 additions & 0 deletions lib/draper/tasks/tu.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rake::Task["test:run"].enhance do
Rake::Task["test:decorators"].invoke
end
9 changes: 9 additions & 0 deletions lib/draper/test/test_unit_integration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "rake/testtask"
require "rails/test_unit/sub_test_task"

namespace :test do
Rails::SubTestTask.new(:decorators => "test:prepare") do |t|
t.libs << "test"
t.pattern = "test/decorators/**/*_test.rb"
end
end

0 comments on commit 087e134

Please sign in to comment.