{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/23f4d5d797a91b6d17d627b90b5a42d9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"23f4d5d797a91b6d17d627b90b5a42d9","url":"https://api.github.com/users/kentaro","login":"kentaro","id":3458},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-03T16:15:05Z","comments":1,"closed_at":"2011-11-03T16:15:05Z","url":"https://api.github.com/repos/nekokak/p5-Teng/issues/30","body":"以下のテストはfailします。これが仕様なのかどうかわかりませんが、個人的には不自然に感じました。\r\n\r\n1. inflateに、`Str -> Object`が指定されているので、`$row->name()`は期待通り`Mock::Inflate::Name`のインスタンスを返す\r\n2. deflateに`(Object|Str) -> Str`が指定されているので、文字列をわたして`update()`する\r\n3. その後、再度`$row->name()`を呼ぶと、2でわたした値がそのまま返ってくる。\r\n\r\nこの3で返ってくる値はinflateされたもの、つまり、1と同じ型のものが返ってくるのが自然なように思うのですが、いかがでしょうか。\r\n\r\n    use t::Utils;\r\n    use Test::More;\r\n    use Mock::Inflate;\r\n\r\n    my $dbh = t::Utils->setup_dbh;\r\n    my $db  = Mock::Inflate->new({ dbh => $dbh });\r\n       $db->setup_test_db;\r\n       $db->insert('mock_inflate', {\r\n           id   => 1,\r\n           name => 'perl',\r\n       });\r\n\r\n    subtest \"update() doesn't break inflation after called\" => sub {\r\n        my $row = $db->single(mock_inflate => { id => 1 });\r\n        isa_ok $row->name, 'Mock::Inflate::Name';\r\n\r\n        $row->update({ name => 'python' });\r\n        isa_ok $row->name, 'Mock::Inflate::Name';\r\n    };\r\n\r\n    done_testing;\r\n","html_url":"https://github.com/nekokak/p5-Teng/issues/30","number":30,"title":"Teng::Row#update()発行後のinflateについて","id":2124583,"created_at":"2011-11-02T18:19:03Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/6a4f5a57f6afbcff5bb4f69935cdc3db?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6a4f5a57f6afbcff5bb4f69935cdc3db","url":"https://api.github.com/users/nekokak","login":"nekokak","id":47076},"updated_at":"2011-11-03T16:15:05Z","url":"https://api.github.com/repos/nekokak/p5-Teng/issues/comments/2619154","body":"指摘いただいた通りバグってましたね＞＜\r\n修正してpushしてみました。\r\n\r\n原因としてはrow経由のupdateでdeflateの処理が抜けていた感じです。\r\n","id":2619154,"created_at":"2011-11-03T16:15:05Z"}}