Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Moved ParanoidBaseTest to test_helper for easier inclusion in multipl…
Browse files Browse the repository at this point in the history
…e test files
  • Loading branch information
softcraft-development committed Dec 6, 2011
1 parent bb970fc commit 2c8768e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
25 changes: 0 additions & 25 deletions test/rails3_acts_as_paranoid_test.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,30 +1,5 @@
require 'test_helper' require 'test_helper'


class ParanoidBaseTest < ActiveSupport::TestCase
def assert_empty(collection)
assert(collection.respond_to?(:empty?) && collection.empty?)
end

def setup
setup_db

["paranoid", "really paranoid", "extremely paranoid"].each do |name|
ParanoidTime.create! :name => name
ParanoidBoolean.create! :name => name
end

ParanoidString.create! :name => "strings can be paranoid"
NotParanoid.create! :name => "no paranoid goals"
ParanoidWithCallback.create! :name => "paranoid with callbacks"

ParanoidObserver.instance.reset
end

def teardown
teardown_db
end
end

class ParanoidTest < ParanoidBaseTest class ParanoidTest < ParanoidBaseTest
def test_fake_removal def test_fake_removal
assert_equal 3, ParanoidTime.count assert_equal 3, ParanoidTime.count
Expand Down
26 changes: 26 additions & 0 deletions test/test_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -270,3 +270,29 @@ def reset
end end


ParanoidWithCallback.add_observer(ParanoidObserver.instance) ParanoidWithCallback.add_observer(ParanoidObserver.instance)


class ParanoidBaseTest < ActiveSupport::TestCase
def assert_empty(collection)
assert(collection.respond_to?(:empty?) && collection.empty?)
end

def setup
setup_db

["paranoid", "really paranoid", "extremely paranoid"].each do |name|
ParanoidTime.create! :name => name
ParanoidBoolean.create! :name => name
end

ParanoidString.create! :name => "strings can be paranoid"
NotParanoid.create! :name => "no paranoid goals"
ParanoidWithCallback.create! :name => "paranoid with callbacks"

ParanoidObserver.instance.reset
end

def teardown
teardown_db
end
end

0 comments on commit 2c8768e

Please sign in to comment.