Skip to content

Commit

Permalink
Revert "another attempt to fix specs in CI"
Browse files Browse the repository at this point in the history
This reverts commit 0141acb.
  • Loading branch information
cap10morgan committed Mar 18, 2011
1 parent 0141acb commit 4abad30
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
24 changes: 0 additions & 24 deletions lib/mailmanager.rb
Expand Up @@ -7,24 +7,6 @@
require 'mailmanager/lib'
require 'mailmanager/list'

# Add a method to destroy the MailManager::Base singleton
# so tests have a clean slate each time.
# Found this here: http://blog.ardes.com/2006/12/11/testing-singletons-with-ruby
require 'singleton'
class <<Singleton
def included_with_reset(klass)
included_without_reset(klass)
class <<klass
def reset_instance
Singleton.send :__init__, self
self
end
end
end
alias_method :included_without_reset, :included
alias_method :included, :included_with_reset
end

module MailManager
@root = nil
@python = '/usr/bin/env python'
Expand Down Expand Up @@ -75,12 +57,6 @@ def initialize #:nodoc:
@lib = MailManager::Lib.new
end

# Need this because w/o it, the singleton pattern makes the tests
# leak side-effects across from test-to-test
# def destroy! #:nodoc:
# @lib = nil
# end

# If you want to use a non-default python executable to run the Python
# portions of this gem, set its full path here. Since we require Python
# 2.6+ and some distros don't ship with that version, you can point this at
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/mailmanager_spec.rb
Expand Up @@ -42,7 +42,7 @@
after :each do
# since subject is a singleton, side-effects of tests will leak unless
# we destroy and re-create it every test
MailManager::Base.reset_instance
subject = nil
end

it "should raise an error if one of the bin files is missing" do
Expand Down

0 comments on commit 4abad30

Please sign in to comment.