test/yao/resources/test_base.rb in yao-0.15.0 vs test/yao/resources/test_base.rb in yao-0.16.0

- old
+ new

@@ -21,6 +21,27 @@ base = Yao::Resources::Base.new({"empty" => ""}) base.class.map_attribute_to_resource empty: NilClass assert_equal(nil, base.empty) end + def test_update + stub(Yao::Resources::Base).update('foo', {name: 'BAR'}) { Yao::Resources::Base.new('id' => 'foo', 'name' => 'BAR')} + base = Yao::Resources::Base.new({'id' => 'foo', 'name' => 'bar'}) + got = base.update(name: 'BAR') + assert_equal(got.name, 'BAR') + end + + def test_destroy + stub(Yao::Resources::Base).destroy('foo') { nil } + base = Yao::Resources::Base.new({'id' => 'foo'}) + got = base.destroy + assert_equal(got, nil) + end + + def test_delete + stub(Yao::Resources::Base).destroy('foo') { nil } + base = Yao::Resources::Base.new({'id' => 'foo'}) + got = base.delete + assert_equal(got, nil) + end + end