Sha256: 98d03bf5d8c7cbe27d088dc3aa64e8bc7333e387787b20511349690b16721cf9

Contents?: true

Size: 514 Bytes

Versions: 40

Compression:

Stored size: 514 Bytes

Contents

require File.join(File.expand_path(__FILE__).sub(/\/ftw\/.*/, "/testing"))
require "ftw/singleton"

describe FTW::Singleton do
  test "extending with FTW::Singleton gives a singleton method" do
    class Foo
      extend FTW::Singleton
    end
    assert_respond_to(Foo, :singleton)
  end

  test "FTW::Singleton gives a singleton instance" do
    class Foo
      extend FTW::Singleton
    end
    assert_instance_of(Foo, Foo.singleton)
    assert_equal(Foo.singleton.object_id, Foo.singleton.object_id)
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
ftw-0.0.49 test/ftw/singleton.rb
ftw-0.0.48 test/ftw/singleton.rb
ftw-0.0.47 test/ftw/singleton.rb
ftw-0.0.46 test/ftw/singleton.rb
ftw-0.0.45 test/ftw/singleton.rb
ftw-0.0.44 test/ftw/singleton.rb
ftw-0.0.43 test/ftw/singleton.rb
ftw-0.0.42 test/ftw/singleton.rb
ftw-0.0.41 test/ftw/singleton.rb
ftw-0.0.40 test/ftw/singleton.rb
ftw-0.0.39 test/ftw/singleton.rb
ftw-0.0.38 test/ftw/singleton.rb
ftw-0.0.37 test/ftw/singleton.rb
ftw-0.0.36 test/ftw/singleton.rb
ftw-0.0.35 test/ftw/singleton.rb
ftw-0.0.34 test/ftw/singleton.rb
ftw-0.0.33 test/ftw/singleton.rb
ftw-0.0.32 test/ftw/singleton.rb
ftw-0.0.31 test/ftw/singleton.rb
ftw-0.0.30 test/ftw/singleton.rb