Sha256: 15f6e55749cf6736aac05bbd2105a82d5d6aca5b44ddcb1791a0636fe694067b

Contents?: true

Size: 398 Bytes

Versions: 6

Compression:

Stored size: 398 Bytes

Contents

# Reset singleton
# http://blog.ardes.com/2006/12/11/testing-singletons-with-ruby
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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sitemap-0.2 test/singleton.rb
sitemap-0.2b2 test/singleton.rb
sitemap-0.2b test/singleton.rb
sitemap-0.1 test/singleton.rb
sitemap-0.1b2 test/singleton.rb
sitemap-0.1b test/singleton.rb