{"action":"created","comment":{"url":"https://api.github.com/repos/state-machines/state_machines/pulls/comments/82367906","pull_request_review_id":3280587,"id":82367906,"diff_hunk":"@@ -0,0 +1,53 @@\n+require_relative '../../test_helper'\n+\n+class MachineWithActionDefinedInPrependedModuleTest < StateMachinesTest\n+  def setup\n+    @mod = mod = Module.new do\n+      def save\n+      end\n+    end\n+\n+    @klass = Class.new do\n+      prepend mod\n+\n+      def bar\n+      end\n+    end\n+\n+    @machine = StateMachines::Machine.new(@klass, action: :save)\n+    @object = @klass.new\n+  end\n+\n+  def test_should_define_an_event_attribute_reader\n+    assert @object.respond_to?(:state_event)\n+  end\n+\n+  def test_should_define_an_event_attribute_writer\n+    assert @object.respond_to?(:state_event=)\n+  end\n+\n+  def test_should_define_an_event_transition_attribute_reader\n+    assert @object.respond_to?(:state_event_transition, true)\n+  end\n+\n+  def test_should_define_an_event_transition_attribute_writer\n+    assert @object.respond_to?(:state_event_transition=, true)\n+  end\n+\n+  def test_should_not_define_action\n+    assert @klass.ancestors.none? { |ancestor| ![@klass, @mod].include?(ancestor) && ancestor.method_defined?(:save) }\n+  end\n+\n+  def test_should_keep_action_public\n+    assert @klass.public_method_defined?(:save)\n+  end\n+\n+  def test_should_mark_action_hook_as_defined\n+    assert (not @machine.action_hook?)","path":"test/unit/machine/machine_with_action_defined_in_prepended_module_test.rb","position":46,"original_position":46,"commit_id":"08e4a7cb5a34294c45f40daac34b4ff468b9332a","original_commit_id":"08e4a7cb5a34294c45f40daac34b4ff468b9332a","user":{"login":"seuros","id":2394703,"avatar_url":"https://avatars.githubusercontent.com/u/2394703?v=3","gravatar_id":"","url":"https://api.github.com/users/seuros","html_url":"https://github.com/seuros","followers_url":"https://api.github.com/users/seuros/followers","following_url":"https://api.github.com/users/seuros/following{/other_user}","gists_url":"https://api.github.com/users/seuros/gists{/gist_id}","starred_url":"https://api.github.com/users/seuros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seuros/subscriptions","organizations_url":"https://api.github.com/users/seuros/orgs","repos_url":"https://api.github.com/users/seuros/repos","events_url":"https://api.github.com/users/seuros/events{/privacy}","received_events_url":"https://api.github.com/users/seuros/received_events","type":"User","site_admin":false},"body":"refute @machine.action_hook?","created_at":"2016-10-07T10:53:01Z","updated_at":"2016-10-07T10:53:09Z","html_url":"https://github.com/state-machines/state_machines/pull/45#discussion_r82367906","pull_request_url":"https://api.github.com/repos/state-machines/state_machines/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/state-machines/state_machines/pulls/comments/82367906"},"html":{"href":"https://github.com/state-machines/state_machines/pull/45#discussion_r82367906"},"pull_request":{"href":"https://api.github.com/repos/state-machines/state_machines/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/state-machines/state_machines/pulls/45","id":83793795,"html_url":"https://github.com/state-machines/state_machines/pull/45","diff_url":"https://github.com/state-machines/state_machines/pull/45.diff","patch_url":"https://github.com/state-machines/state_machines/pull/45.patch","issue_url":"https://api.github.com/repos/state-machines/state_machines/issues/45","number":45,"state":"open","locked":false,"title":"Support prepend module","user":{"login":"DanielePalombo","id":387690,"avatar_url":"https://avatars.githubusercontent.com/u/387690?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielePalombo","html_url":"https://github.com/DanielePalombo","followers_url":"https://api.github.com/users/DanielePalombo/followers","following_url":"https://api.github.com/users/DanielePalombo/following{/other_user}","gists_url":"https://api.github.com/users/DanielePalombo/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielePalombo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielePalombo/subscriptions","organizations_url":"https://api.github.com/users/DanielePalombo/orgs","repos_url":"https://api.github.com/users/DanielePalombo/repos","events_url":"https://api.github.com/users/DanielePalombo/events{/privacy}","received_events_url":"https://api.github.com/users/DanielePalombo/received_events","type":"User","site_admin":false},"body":"`owner_class_ancestor_has_method?` search if method is already defined in one of ancestors list class.\r\n\r\nThe method searches through the list of ancestors filtering out only the classes after excluding the first\r\nelement of the list.\r\nIf a module is prepended exclude the first element\r\nof the list( the prepended module) and then the first class return\r\nthe owner_class.\r\n\r\nReverse the flow so that exclude the first element after filtering out only the classes.","created_at":"2016-09-02T12:31:49Z","updated_at":"2016-10-07T10:53:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85b7083f5b54e192983f58e613713bc440fcd94b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/state-machines/state_machines/pulls/45/commits","review_comments_url":"https://api.github.com/repos/state-machines/state_machines/pulls/45/comments","review_comment_url":"https://api.github.com/repos/state-machines/state_machines/pulls/comments{/number}","comments_url":"https://api.github.com/repos/state-machines/state_machines/issues/45/comments","statuses_url":"https://api.github.com/repos/state-machines/state_machines/statuses/08e4a7cb5a34294c45f40daac34b4ff468b9332a","head":{"label":"DanielePalombo:nebulab/support-prepend","ref":"nebulab/support-prepend","sha":"08e4a7cb5a34294c45f40daac34b4ff468b9332a","user":{"login":"DanielePalombo","id":387690,"avatar_url":"https://avatars.githubusercontent.com/u/387690?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielePalombo","html_url":"https://github.com/DanielePalombo","followers_url":"https://api.github.com/users/DanielePalombo/followers","following_url":"https://api.github.com/users/DanielePalombo/following{/other_user}","gists_url":"https://api.github.com/users/DanielePalombo/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielePalombo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielePalombo/subscriptions","organizations_url":"https://api.github.com/users/DanielePalombo/orgs","repos_url":"https://api.github.com/users/DanielePalombo/repos","events_url":"https://api.github.com/users/DanielePalombo/events{/privacy}","received_events_url":"https://api.github.com/users/DanielePalombo/received_events","type":"User","site_admin":false},"repo":{"id":65538531,"name":"state_machines","full_name":"DanielePalombo/state_machines","owner":{"login":"DanielePalombo","id":387690,"avatar_url":"https://avatars.githubusercontent.com/u/387690?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielePalombo","html_url":"https://github.com/DanielePalombo","followers_url":"https://api.github.com/users/DanielePalombo/followers","following_url":"https://api.github.com/users/DanielePalombo/following{/other_user}","gists_url":"https://api.github.com/users/DanielePalombo/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielePalombo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielePalombo/subscriptions","organizations_url":"https://api.github.com/users/DanielePalombo/orgs","repos_url":"https://api.github.com/users/DanielePalombo/repos","events_url":"https://api.github.com/users/DanielePalombo/events{/privacy}","received_events_url":"https://api.github.com/users/DanielePalombo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DanielePalombo/state_machines","description":"Adds support for creating state machines for attributes on any Ruby class","fork":true,"url":"https://api.github.com/repos/DanielePalombo/state_machines","forks_url":"https://api.github.com/repos/DanielePalombo/state_machines/forks","keys_url":"https://api.github.com/repos/DanielePalombo/state_machines/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DanielePalombo/state_machines/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DanielePalombo/state_machines/teams","hooks_url":"https://api.github.com/repos/DanielePalombo/state_machines/hooks","issue_events_url":"https://api.github.com/repos/DanielePalombo/state_machines/issues/events{/number}","events_url":"https://api.github.com/repos/DanielePalombo/state_machines/events","assignees_url":"https://api.github.com/repos/DanielePalombo/state_machines/assignees{/user}","branches_url":"https://api.github.com/repos/DanielePalombo/state_machines/branches{/branch}","tags_url":"https://api.github.com/repos/DanielePalombo/state_machines/tags","blobs_url":"https://api.github.com/repos/DanielePalombo/state_machines/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DanielePalombo/state_machines/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DanielePalombo/state_machines/git/refs{/sha}","trees_url":"https://api.github.com/repos/DanielePalombo/state_machines/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DanielePalombo/state_machines/statuses/{sha}","languages_url":"https://api.github.com/repos/DanielePalombo/state_machines/languages","stargazers_url":"https://api.github.com/repos/DanielePalombo/state_machines/stargazers","contributors_url":"https://api.github.com/repos/DanielePalombo/state_machines/contributors","subscribers_url":"https://api.github.com/repos/DanielePalombo/state_machines/subscribers","subscription_url":"https://api.github.com/repos/DanielePalombo/state_machines/subscription","commits_url":"https://api.github.com/repos/DanielePalombo/state_machines/commits{/sha}","git_commits_url":"https://api.github.com/repos/DanielePalombo/state_machines/git/commits{/sha}","comments_url":"https://api.github.com/repos/DanielePalombo/state_machines/comments{/number}","issue_comment_url":"https://api.github.com/repos/DanielePalombo/state_machines/issues/comments{/number}","contents_url":"https://api.github.com/repos/DanielePalombo/state_machines/contents/{+path}","compare_url":"https://api.github.com/repos/DanielePalombo/state_machines/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DanielePalombo/state_machines/merges","archive_url":"https://api.github.com/repos/DanielePalombo/state_machines/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DanielePalombo/state_machines/downloads","issues_url":"https://api.github.com/repos/DanielePalombo/state_machines/issues{/number}","pulls_url":"https://api.github.com/repos/DanielePalombo/state_machines/pulls{/number}","milestones_url":"https://api.github.com/repos/DanielePalombo/state_machines/milestones{/number}","notifications_url":"https://api.github.com/repos/DanielePalombo/state_machines/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DanielePalombo/state_machines/labels{/name}","releases_url":"https://api.github.com/repos/DanielePalombo/state_machines/releases{/id}","deployments_url":"https://api.github.com/repos/DanielePalombo/state_machines/deployments","created_at":"2016-08-12T08:49:45Z","updated_at":"2016-08-12T08:49:47Z","pushed_at":"2016-09-01T21:56:04Z","git_url":"git://github.com/DanielePalombo/state_machines.git","ssh_url":"git@github.com:DanielePalombo/state_machines.git","clone_url":"https://github.com/DanielePalombo/state_machines.git","svn_url":"https://github.com/DanielePalombo/state_machines","homepage":"https://github.com/state-machines/state_machines","size":380,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"state-machines:master","ref":"master","sha":"eafbab71fb6e6ba63fdd50303a725c0f0f88145d","user":{"login":"state-machines","id":7613709,"avatar_url":"https://avatars.githubusercontent.com/u/7613709?v=3","gravatar_id":"","url":"https://api.github.com/users/state-machines","html_url":"https://github.com/state-machines","followers_url":"https://api.github.com/users/state-machines/followers","following_url":"https://api.github.com/users/state-machines/following{/other_user}","gists_url":"https://api.github.com/users/state-machines/gists{/gist_id}","starred_url":"https://api.github.com/users/state-machines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/state-machines/subscriptions","organizations_url":"https://api.github.com/users/state-machines/orgs","repos_url":"https://api.github.com/users/state-machines/repos","events_url":"https://api.github.com/users/state-machines/events{/privacy}","received_events_url":"https://api.github.com/users/state-machines/received_events","type":"Organization","site_admin":false},"repo":{"id":19219215,"name":"state_machines","full_name":"state-machines/state_machines","owner":{"login":"state-machines","id":7613709,"avatar_url":"https://avatars.githubusercontent.com/u/7613709?v=3","gravatar_id":"","url":"https://api.github.com/users/state-machines","html_url":"https://github.com/state-machines","followers_url":"https://api.github.com/users/state-machines/followers","following_url":"https://api.github.com/users/state-machines/following{/other_user}","gists_url":"https://api.github.com/users/state-machines/gists{/gist_id}","starred_url":"https://api.github.com/users/state-machines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/state-machines/subscriptions","organizations_url":"https://api.github.com/users/state-machines/orgs","repos_url":"https://api.github.com/users/state-machines/repos","events_url":"https://api.github.com/users/state-machines/events{/privacy}","received_events_url":"https://api.github.com/users/state-machines/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/state-machines/state_machines","description":"Adds support for creating state machines for attributes on any Ruby class","fork":false,"url":"https://api.github.com/repos/state-machines/state_machines","forks_url":"https://api.github.com/repos/state-machines/state_machines/forks","keys_url":"https://api.github.com/repos/state-machines/state_machines/keys{/key_id}","collaborators_url":"https://api.github.com/repos/state-machines/state_machines/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/state-machines/state_machines/teams","hooks_url":"https://api.github.com/repos/state-machines/state_machines/hooks","issue_events_url":"https://api.github.com/repos/state-machines/state_machines/issues/events{/number}","events_url":"https://api.github.com/repos/state-machines/state_machines/events","assignees_url":"https://api.github.com/repos/state-machines/state_machines/assignees{/user}","branches_url":"https://api.github.com/repos/state-machines/state_machines/branches{/branch}","tags_url":"https://api.github.com/repos/state-machines/state_machines/tags","blobs_url":"https://api.github.com/repos/state-machines/state_machines/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/state-machines/state_machines/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/state-machines/state_machines/git/refs{/sha}","trees_url":"https://api.github.com/repos/state-machines/state_machines/git/trees{/sha}","statuses_url":"https://api.github.com/repos/state-machines/state_machines/statuses/{sha}","languages_url":"https://api.github.com/repos/state-machines/state_machines/languages","stargazers_url":"https://api.github.com/repos/state-machines/state_machines/stargazers","contributors_url":"https://api.github.com/repos/state-machines/state_machines/contributors","subscribers_url":"https://api.github.com/repos/state-machines/state_machines/subscribers","subscription_url":"https://api.github.com/repos/state-machines/state_machines/subscription","commits_url":"https://api.github.com/repos/state-machines/state_machines/commits{/sha}","git_commits_url":"https://api.github.com/repos/state-machines/state_machines/git/commits{/sha}","comments_url":"https://api.github.com/repos/state-machines/state_machines/comments{/number}","issue_comment_url":"https://api.github.com/repos/state-machines/state_machines/issues/comments{/number}","contents_url":"https://api.github.com/repos/state-machines/state_machines/contents/{+path}","compare_url":"https://api.github.com/repos/state-machines/state_machines/compare/{base}...{head}","merges_url":"https://api.github.com/repos/state-machines/state_machines/merges","archive_url":"https://api.github.com/repos/state-machines/state_machines/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/state-machines/state_machines/downloads","issues_url":"https://api.github.com/repos/state-machines/state_machines/issues{/number}","pulls_url":"https://api.github.com/repos/state-machines/state_machines/pulls{/number}","milestones_url":"https://api.github.com/repos/state-machines/state_machines/milestones{/number}","notifications_url":"https://api.github.com/repos/state-machines/state_machines/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/state-machines/state_machines/labels{/name}","releases_url":"https://api.github.com/repos/state-machines/state_machines/releases{/id}","deployments_url":"https://api.github.com/repos/state-machines/state_machines/deployments","created_at":"2014-04-27T22:05:49Z","updated_at":"2016-10-05T23:37:52Z","pushed_at":"2016-10-07T10:50:06Z","git_url":"git://github.com/state-machines/state_machines.git","ssh_url":"git@github.com:state-machines/state_machines.git","clone_url":"https://github.com/state-machines/state_machines.git","svn_url":"https://github.com/state-machines/state_machines","homepage":"https://github.com/state-machines/state_machines","size":387,"stargazers_count":239,"watchers_count":239,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":32,"mirror_url":null,"open_issues_count":8,"forks":32,"open_issues":8,"watchers":239,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/state-machines/state_machines/pulls/45"},"html":{"href":"https://github.com/state-machines/state_machines/pull/45"},"issue":{"href":"https://api.github.com/repos/state-machines/state_machines/issues/45"},"comments":{"href":"https://api.github.com/repos/state-machines/state_machines/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/state-machines/state_machines/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/state-machines/state_machines/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/state-machines/state_machines/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/state-machines/state_machines/statuses/08e4a7cb5a34294c45f40daac34b4ff468b9332a"}}}}
{"actor":{"display_login":"seuros"}}