{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/comments/46259387","id":46259387,"diff_hunk":"@@ -35,28 +36,66 @@ class ArrayExampleArray < Machinery::Array\n   }\n \n   describe \"#from_json\" do\n-    it \"delegates to specialized class when the element class is set\" do\n-      json_object = [\n-        { a: 1 },\n-        { b: 2 }\n-      ]\n+    describe \"plain arrays\" do\n+      it \"delegates to specialized class when the element class is set\" do\n+        json_object = [\n+          { a: 1 },\n+          { b: 2 }\n+        ]\n \n-      array = ArrayExampleArray.from_json(json_object)\n-      expect(array[0]).to eq(ArrayExampleObject.new(a: 1))\n-      expect(array[1]).to eq(ArrayExampleObject.new(b: 2))\n+        array = ArrayExampleArray.from_json(json_object)\n+        expect(array[0]).to eq(ArrayExampleObject.new(a: 1))\n+        expect(array[1]).to eq(ArrayExampleObject.new(b: 2))\n+      end\n+\n+      it \"uses generic classes when no element class is set\" do\n+        json_object = [1, { 2 => \"2\" }, [3, \"3\"]]\n+\n+        expected = Machinery::Array.new(\n+          [\n+            1,\n+            Machinery::Object.new(2 => \"2\"),\n+            Machinery::Array.new([3, \"3\"])\n+          ]\n+        )\n+        expect(Machinery::Array.from_json(json_object)).to eq(expected)\n+      end\n     end\n \n-    it \"uses generic classes when no element class is set\" do\n-      json_object = [1, {2 => \"2\"}, [3, \"3\"]]\n-\n-      expected = Machinery::Array.new(\n-        [\n-          1,\n-          Machinery::Object.new(2 => \"2\"),\n-          Machinery::Array.new([3, \"3\"])\n-        ]\n-      )\n-      expect(Machinery::Array.from_json(json_object)).to eq(expected)\n+    describe \"complex arrays\" do\n+      let(:array) {\n+        json_object = {\n+          \"_attributes\" => {\n+          },\n+          \"_elements\" => [\n+            1,\n+            2,\n+            {\n+              \"_attributes\" => {},\n+              \"_elements\" => [1]\n+            }\n+          ]\n+        }\n+\n+        Machinery::Array.from_json(json_object)\n+      }\n+\n+      it \"makes the elements available as the payload\" do\n+        expect(array.first).to eq(1)\n+        expect(array[1]).to eq(2)\n+        expect(array[2]).to eq(Machinery::Array.new([1]))\n+      end\n+\n+      it \"raises errors on unknown attributes\" do\n+        expect {\n+          Machinery::Array.from_json({","path":"spec/unit/array_spec.rb","position":83,"original_position":83,"commit_id":"79c45adc0c0d213b334f4db683c9594f69b131d0","original_commit_id":"79c45adc0c0d213b334f4db683c9594f69b131d0","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Redundant curly braces around a hash parameter.","created_at":"2015-12-01T10:02:32Z","updated_at":"2015-12-01T10:02:32Z","html_url":"https://github.com/SUSE/machinery/pull/1720#discussion_r46259387","pull_request_url":"https://api.github.com/repos/SUSE/machinery/pulls/1720","_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments/46259387"},"html":{"href":"https://github.com/SUSE/machinery/pull/1720#discussion_r46259387"},"pull_request":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1720"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/1720","id":52237325,"html_url":"https://github.com/SUSE/machinery/pull/1720","diff_url":"https://github.com/SUSE/machinery/pull/1720.diff","patch_url":"https://github.com/SUSE/machinery/pull/1720.patch","issue_url":"https://api.github.com/repos/SUSE/machinery/issues/1720","number":1720,"state":"open","locked":false,"title":"[Review] Request from 'aduffeck' @ 'SUSE/machinery/review_151126_adapt_packages_data_model3'","user":{"login":"aduffeck","id":203813,"avatar_url":"https://avatars.githubusercontent.com/u/203813?v=3","gravatar_id":"","url":"https://api.github.com/users/aduffeck","html_url":"https://github.com/aduffeck","followers_url":"https://api.github.com/users/aduffeck/followers","following_url":"https://api.github.com/users/aduffeck/following{/other_user}","gists_url":"https://api.github.com/users/aduffeck/gists{/gist_id}","starred_url":"https://api.github.com/users/aduffeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduffeck/subscriptions","organizations_url":"https://api.github.com/users/aduffeck/orgs","repos_url":"https://api.github.com/users/aduffeck/repos","events_url":"https://api.github.com/users/aduffeck/events{/privacy}","received_events_url":"https://api.github.com/users/aduffeck/received_events","type":"User","site_admin":false},"body":"Please review the following changes:\n  * 79c45ad Migrate the fixture descriptions\n  * 7c56f03 Add migration for the file scopes schema changes\n  * 19200d4 Adapt the file scopes to the new array model\n  * 5e5e712 Fix packages scope model change\n  * 1afc1eb Handle array attributes in comparison and array methods\n  * 1be085d Also consider the array attributes when comparing arrays\n  * 23a5736 Rename has_properties to has_attributes\n  * 0880564 Fix test\n  * 3b69a6e Explicitly define the available attributes on arrays\n  * a0e4e66 Fix hound issues\n  * 451e1ac Migrate fixture system descriptions with adapted migration\n  * 3bbb3e5 Make use of the new Machinery::Array attributes in the packages scope\n  * 346bb8e Extend Machinery::Arrays so that they can also store attributes\n  * 4802858 Fix hound issues\n  * 7cf54df Migrate fixture system descriptions\n  * 29e10f9 Adapt packages data model for v6 (to add support for dpkg packages)\n  * 4326ecb Add unchanged schema files for v6\n  * e6166ea Add migration for format version 6","created_at":"2015-12-01T10:01:38Z","updated_at":"2015-12-01T10:02:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3ae77eb7097a2400284ebdd140e83a6aec65f19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/machinery/pulls/1720/commits","review_comments_url":"https://api.github.com/repos/SUSE/machinery/pulls/1720/comments","review_comment_url":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/machinery/issues/1720/comments","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/79c45adc0c0d213b334f4db683c9594f69b131d0","head":{"label":"SUSE:review_151126_adapt_packages_data_model3","ref":"review_151126_adapt_packages_data_model3","sha":"79c45adc0c0d213b334f4db683c9594f69b131d0","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2015-12-01T01:00:39Z","pushed_at":"2015-12-01T10:01:39Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":60744,"stargazers_count":77,"watchers_count":77,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":54,"forks":14,"open_issues":54,"watchers":77,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"534edbda24e9e4d18735b9f1aa7370f9bd6711ff","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2015-12-01T01:00:39Z","pushed_at":"2015-12-01T10:01:39Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":60744,"stargazers_count":77,"watchers_count":77,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":54,"forks":14,"open_issues":54,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1720"},"html":{"href":"https://github.com/SUSE/machinery/pull/1720"},"issue":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1720"},"comments":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1720/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1720/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1720/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/machinery/statuses/79c45adc0c0d213b334f4db683c9594f69b131d0"}}}}