Sha256: 2738e266797a7cf01bfbc2c6e40304d80cfc84c40b0e22cad51de2b4d5f0097f
Contents?: true
Size: 1.16 KB
Versions: 15
Compression:
Stored size: 1.16 KB
Contents
module TestCollection # Anything that includes TestCollection must, during setup, assign @subject and @factory, where # @subject is the collection under test, (e.g. Fog::Compute[:google].servers) # @factory is a CollectionFactory def test_lifecycle one = @subject.new(@factory.params) one.save two = @subject.create(@factory.params) # XXX HACK compares identities # should be replaced with simple includes? when `==` is properly implemented in fog-core; see fog/fog-core#148 assert_includes @subject.all.map(&:identity), one.identity assert_includes @subject.all.map(&:identity), two.identity assert_equal one.identity, @factory.get(one.identity).identity assert_equal two.identity, @factory.get(two.identity).identity one.destroy two.destroy Fog.wait_for { !@subject.all.map(&:identity).include? one.identity } Fog.wait_for { !@subject.all.map(&:identity).include? two.identity } end def test_get_returns_nil_if_resource_does_not_exist assert_nil @factory.get("fog-test-fake-identity") end def test_enumerable assert_respond_to @subject, :each end def teardown @factory.cleanup end end
Version data entries
15 entries across 15 versions & 1 rubygems