mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 08:10:13 +01:00
* Ran rake rails:update * Added old actionwebservice framework * Updated RSpec and RSpec-Rails * Removed asset_packager plugin (not compatible, Scott no longer maintaining), and replaced with bundle_fu. See the bundle_fu README for more info. * Hacks to UJS and ARTS plugins, which are no longer supported. Probably should move off both UJS and RJS. * Hack to flashobject_helper plugin (upgrade to Rails 2.2-compatible version if/when it comes out.) * Hack to skinny-spec plugin, for Rails 2.2 compatibility. Should check for official release. * Hacks to resource_feeder plugin, for Rails 2.2 compatibility. Should check for official release (not likely) or move off it. * Addressed some deprecation warnings. More to come. * My mobile mime type hackery is no longer necessary with new Rails features. Yay! * Updated environment.rb.tmpl with changes TODO: * Restore view specs marked pending * Fix failing integration tests. * Try selenium tests. * Investigate OpenID support. * Address deprecation warnings. * Consider moving parts of environment.rb to initializers * Address annoying config.gem warning about highline gem
66 lines
No EOL
1.6 KiB
Ruby
66 lines
No EOL
1.6 KiB
Ruby
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
|
|
|
|
if ActiveSupport.const_defined?(:Callbacks) && Test::Unit::TestCase.include?(ActiveSupport::Callbacks)
|
|
|
|
class TestUnitTesting < Test::Unit::TestCase
|
|
@@setup_callback_count = 0
|
|
@@setup_method_count = 0
|
|
@@teardown_callback_count = 0
|
|
@@teardown_method_count = 0
|
|
cattr_accessor :setup_callback_count, :setup_method_count, :teardown_callback_count, :teardown_method_count
|
|
|
|
setup :do_some_setup
|
|
teardown :do_some_teardown
|
|
|
|
@@has_been_run = false
|
|
def self.run?
|
|
@@has_been_run
|
|
end
|
|
|
|
def do_some_setup
|
|
@@setup_callback_count += 1
|
|
end
|
|
|
|
def setup
|
|
@@setup_method_count += 1
|
|
end
|
|
|
|
def test_something
|
|
assert_equal true, true
|
|
@@has_been_run = true
|
|
end
|
|
|
|
def teardown
|
|
@@teardown_method_count += 1
|
|
end
|
|
|
|
def do_some_teardown
|
|
@@teardown_callback_count += 1
|
|
end
|
|
end
|
|
|
|
module Test
|
|
module Unit
|
|
describe "Running TestCase tests" do
|
|
before(:all) do
|
|
TestUnitTesting.run unless TestUnitTesting.run?
|
|
end
|
|
|
|
it "should call the setup callbacks" do
|
|
TestUnitTesting.setup_callback_count.should == 1
|
|
end
|
|
it "should still only call the normal setup method once" do
|
|
TestUnitTesting.setup_method_count.should == 1
|
|
end
|
|
it "should call the teardown callbacks" do
|
|
TestUnitTesting.teardown_callback_count.should == 1
|
|
end
|
|
it "should still only call the normal teardown method once" do
|
|
TestUnitTesting.teardown_method_count.should == 1
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
end |