Sha256: ccf45113a6d700746ef322c88e498c21d78a00fd768b8c3a4a0de3c30ac57286

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

class TestRestfullyAccesible < Test::Unit::TestCase
  include Yao::Resources::RestfullyAccessible

  def test_get
    mock(self).find_by_name("dummy", {}) { Struct.new(:body).new("dummy") }
    mock(self).resource_from_json("dummy") { "dummy" }
    mock(self).return_resource("dummy") { "dummy" }

    get("dummy")
    RR.verify
  end

  def test_find_by_name
    mock(self).list({"name" => "dummy"}) { "dummy" }

    assert_equal(find_by_name("dummy"), "dummy")
  end

  def test_uuid?
    assert_equal(uuid?("00112233-4455-6677-8899-aabbccddeeff"), true)

    # not uuid
    assert_equal(uuid?("dummy resource"), false)
    assert_equal(uuid?("00112233445566778899aabbccddeeff"), false)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yao-0.3.8 test/yao/resources/test_restfully_accessible.rb