GitHub PullRequestReviewCommentEvent at 2014-11-10 19:23:49
Repository: osullivan
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/jpstroop/osullivan/pulls/comments/20105497","id":20105497,"diff_hunk":"@@ -0,0 +1,172 @@\n+describe IIIF::Presentation::Sequence do\n+\n+\tlet(:subclass_subject) do\n+\t\tClass.new(IIIF::Presentation::Sequence) do\n+\t\t\tdef initialize(hsh={})\n+\t\t\t\thsh = { '@type' => 'a:SubClass' }\n+\t\t\t\tsuper(hsh)\n+\t\t\tend\n+\t\tend\n+\tend\n+\n+\tlet(:fixed_values) do\n+\t\t{\n+\t\t\t'@type' => 'sc:Sequence',\n+\t\t\t'@id' => 'http://example.com/prefix/sequence/456',\n+\t\t\t'@context' => IIIF::Presentation::CONTEXT,\n+\t\t\t'label' => 'Book 1',\n+\t\t\t'description' => 'A longer description of this example book. It should give some real information.',\n+\t\t\t'thumbnail' => {\n+\t\t\t\t'@id' => 'http://www.example.org/images/book1-page1/full/80,100/0/default.jpg',\n+\t\t\t\t'service'=> {\n+\t\t\t\t\t'@context' => 'http://iiif.io/api/image/2/context.json',\n+\t\t\t\t\t'@id' => 'http://www.example.org/images/book1-page1',\n+\t\t\t\t\t'profile' => 'http://iiif.io/api/image/2/level1.json'\n+\t\t\t\t}\n+\t\t\t},\n+\t\t\t'attribution' => 'Provided by Example Organization',\n+\t\t\t'license' => 'http://www.example.org/license.html',\n+\t\t\t'logo' => 'http://www.example.org/logos/institution1.jpg',\n+\t\t\t'see_also' => 'http://www.example.org/library/catalog/book1.xml',\n+\t\t\t'service' => {\n+\t\t\t\t'@context' => 'http://example.org/ns/jsonld/context.json',\n+\t\t\t\t'@id' =>  'http://example.org/service/example',\n+\t\t\t\t'profile' => 'http://example.org/docs/example-service.html'\n+\t\t\t},\n+\t\t\t'related' => {\n+\t\t\t\t'@id' => 'http://www.example.org/videos/video-book1.mpg',\n+\t\t\t\t'format' => 'video/mpeg'\n+\t\t\t},\n+\t\t\t'within' => 'http://www.example.org/collections/books/',\n+\t\t\t# Sequence\n+\t\t\t'metadata' => [{'label'=>'Author', 'value'=>'Anne Author'}],\n+\t\t\t'canvases' => [{\n+\t\t\t\t'@id' => 'http://www.example.org/iiif/book1/canvas/p1',\n+\t\t\t\t'@type' => 'sc:Canvas',\n+\t\t\t\t'label' => 'p. 1',\n+\t\t\t\t'height' => 1000,\n+\t\t\t\t'width' => 750,\n+\t\t\t\t'images'=>  []\n+\t\t\t}],\n+\t\t\t'viewing_hint' => 'paged',\n+\t\t\t'start_canvas' => 'http://www.example.org/iiif/book1/canvas/p2',\n+\t\t\t'viewing_direction' => 'right-to-left',\n+\t\t}\n+\tend\n+\n+\tdescribe '#initialize' do\n+\t\tit 'sets @type to sc:Sequence by default' do\n+\t\t\texpect(subject['@type']).to eq 'sc:Sequence'\n+\t\tend\n+\t\tit 'allows subclasses to override @type' do\n+\t\t\tsub = subclass_subject.new\n+\t\t\texpect(sub['@type']).to eq 'a:SubClass'\n+\t\tend\n+\tend\n+\n+\tdescribe '#required_keys' do\n+\t\tit 'accumulates from the superclass' do\n+\t\t\texpect(subject.required_keys).to eq %w{ @type }\n+\t\tend\n+\tend\n+\n+\tdescribe '#string_only_keys' do\n+\t\tit 'accumulates from the superclass' do\n+\t\t\texpect(subject.string_only_keys).to eq %w{ viewing_hint start_canvas viewing_direction }\n+\t\tend\n+\tend\n+\n+\tdescribe '#array_only_keys' do\n+\t\tit 'accumulates from the superclass' do\n+\t\t\texpect(subject.array_only_keys).to eq %w{ metadata canvases }\n+\t\tend\n+\tend\n+\n+\tdescribe 'Array only key accessor and mutators' do\n+\t\tIIIF::Presentation::Sequence.new.array_only_keys.each do |prop|\n+\t\t\tdescribe \"#{prop}=\" do\n+\t\t\t\tit \"sets #{prop}\" do\n+\t\t\t\t\tex = [{'label' => 'XYZ'}]\n+\t\t\t\t\tsubject.send(\"#{prop}=\", ex)\n+\t\t\t\t\texpect(subject[prop]).to eq ex\n+\t\t\t\tend\n+\t\t\t\tit 'raises an exception when attempting to set it to something other than an Array' do\n+\t\t\t\t\texpect { subject.send(\"#{prop}=\", 'Foo') }.to raise_error TypeError\n+\t\t\t\tend\n+\t\t\tend\n+\t\t\tdescribe \"#{prop}\" do\n+\t\t\t\tit \"gets #{prop}\" do\n+\t\t\t\t\tex = [{'label' => 'XYZ'}]\n+\t\t\t\t\tsubject[prop] = ex\n+\t\t\t\t\texpect(subject.send(prop)).to eq ex\n+\t\t\t\tend\n+\t\t\tend\n+\t\tend\n+\tend\n+\n+\tdescribe 'String-only key accessor and mutators' do\n+\t\tIIIF::Presentation::Sequence.new.string_only_keys.each do |prop|\n+\t\t\tdescribe \"#{prop}=\" do\n+\t\t\t\tit \"sets #{prop}\" do\n+\t\t\t\t\tex = 'foo'\n+\t\t\t\t\tsubject.send(\"#{prop}=\", ex)\n+\t\t\t\t\texpect(subject[prop]).to eq ex\n+\t\t\t\tend\n+\t\t\t\tit 'raises an exception when attempting to set it to something other than a String' do\n+\t\t\t\t\texpect { subject.send(\"#{prop}=\", ['Foo']) }.to raise_error TypeError\n+\t\t\t\tend\n+\t\t\tend\n+\t\t\tdescribe \"#{prop}\" do\n+\t\t\t\tit \"gets #{prop}\" do\n+\t\t\t\t\tex = 'bar'\n+\t\t\t\t\tsubject[prop] = ex\n+\t\t\t\t\texpect(subject.send(prop)).to eq ex\n+\t\t\t\tend\n+\t\t\tend\n+\t\tend\n+\tend\n+\n+\tdescribe 'Attributes allowed anywhere' do\n+\t\tIIIF::Presentation::Sequence.new.any_type_keys.each do |prop|\n+\t\t\tdescribe \"##{prop}=\" do\n+\t\t\t\tit \"sets self['#{prop}']\" do\n+\t\t\t\t\tsubject.send(\"#{prop}=\", fixed_values[prop])\n+\t\t\t\t\texpect(subject[\"#{prop}\"]).to eq fixed_values[prop]\n+\t\t\t\tend\n+\t\t\t\tif prop.camelize(:lower) != prop\n+\t\t\t\t\tit \"is aliased as ##{prop.camelize(:lower)}=\" do\n+\t\t\t\t\t\tsubject.send(\"#{prop.camelize(:lower)}=\", fixed_values[prop])\n+\t\t\t\t\t\texpect(subject[\"#{prop}\"]).to eq fixed_values[prop]","path":"spec/units/iiif/presentation/sequence_spec.rb","position":139,"original_position":139,"commit_id":"618ad56d1eb3c2eb62d0a37bbf70caae2091b7a5","original_commit_id":"618ad56d1eb3c2eb62d0a37bbf70caae2091b7a5","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":"Tab detected.","created_at":"2014-11-10T19:23:49Z","updated_at":"2014-11-10T19:23:49Z","html_url":"https://github.com/jpstroop/osullivan/pull/16#discussion_r20105497","pull_request_url":"https://api.github.com/repos/jpstroop/osullivan/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/jpstroop/osullivan/pulls/comments/20105497"},"html":{"href":"https://github.com/jpstroop/osullivan/pull/16#discussion_r20105497"},"pull_request":{"href":"https://api.github.com/repos/jpstroop/osullivan/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/jpstroop/osullivan/pulls/16","id":24170428,"html_url":"https://github.com/jpstroop/osullivan/pull/16","diff_url":"https://github.com/jpstroop/osullivan/pull/16.diff","patch_url":"https://github.com/jpstroop/osullivan/pull/16.patch","issue_url":"https://api.github.com/repos/jpstroop/osullivan/issues/16","number":16,"state":"open","locked":false,"title":"Implements sequence (except validations). Closes #8","user":{"login":"jpstroop","id":999701,"avatar_url":"https://avatars.githubusercontent.com/u/999701?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstroop","html_url":"https://github.com/jpstroop","followers_url":"https://api.github.com/users/jpstroop/followers","following_url":"https://api.github.com/users/jpstroop/following{/other_user}","gists_url":"https://api.github.com/users/jpstroop/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstroop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstroop/subscriptions","organizations_url":"https://api.github.com/users/jpstroop/orgs","repos_url":"https://api.github.com/users/jpstroop/repos","events_url":"https://api.github.com/users/jpstroop/events{/privacy}","received_events_url":"https://api.github.com/users/jpstroop/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-10T19:23:25Z","updated_at":"2014-11-10T19:23:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7df860c7cb6e664f76d6a8970e15d479c6f6280d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jpstroop/osullivan/pulls/16/commits","review_comments_url":"https://api.github.com/repos/jpstroop/osullivan/pulls/16/comments","review_comment_url":"https://api.github.com/repos/jpstroop/osullivan/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jpstroop/osullivan/issues/16/comments","statuses_url":"https://api.github.com/repos/jpstroop/osullivan/statuses/618ad56d1eb3c2eb62d0a37bbf70caae2091b7a5","head":{"label":"jpstroop:implement_sequence","ref":"implement_sequence","sha":"618ad56d1eb3c2eb62d0a37bbf70caae2091b7a5","user":{"login":"jpstroop","id":999701,"avatar_url":"https://avatars.githubusercontent.com/u/999701?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstroop","html_url":"https://github.com/jpstroop","followers_url":"https://api.github.com/users/jpstroop/followers","following_url":"https://api.github.com/users/jpstroop/following{/other_user}","gists_url":"https://api.github.com/users/jpstroop/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstroop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstroop/subscriptions","organizations_url":"https://api.github.com/users/jpstroop/orgs","repos_url":"https://api.github.com/users/jpstroop/repos","events_url":"https://api.github.com/users/jpstroop/events{/privacy}","received_events_url":"https://api.github.com/users/jpstroop/received_events","type":"User","site_admin":false},"repo":{"id":26245866,"name":"osullivan","full_name":"jpstroop/osullivan","owner":{"login":"jpstroop","id":999701,"avatar_url":"https://avatars.githubusercontent.com/u/999701?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstroop","html_url":"https://github.com/jpstroop","followers_url":"https://api.github.com/users/jpstroop/followers","following_url":"https://api.github.com/users/jpstroop/following{/other_user}","gists_url":"https://api.github.com/users/jpstroop/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstroop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstroop/subscriptions","organizations_url":"https://api.github.com/users/jpstroop/orgs","repos_url":"https://api.github.com/users/jpstroop/repos","events_url":"https://api.github.com/users/jpstroop/events{/privacy}","received_events_url":"https://api.github.com/users/jpstroop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpstroop/osullivan","description":"API for creating IIIF Manifests","fork":false,"url":"https://api.github.com/repos/jpstroop/osullivan","forks_url":"https://api.github.com/repos/jpstroop/osullivan/forks","keys_url":"https://api.github.com/repos/jpstroop/osullivan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpstroop/osullivan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpstroop/osullivan/teams","hooks_url":"https://api.github.com/repos/jpstroop/osullivan/hooks","issue_events_url":"https://api.github.com/repos/jpstroop/osullivan/issues/events{/number}","events_url":"https://api.github.com/repos/jpstroop/osullivan/events","assignees_url":"https://api.github.com/repos/jpstroop/osullivan/assignees{/user}","branches_url":"https://api.github.com/repos/jpstroop/osullivan/branches{/branch}","tags_url":"https://api.github.com/repos/jpstroop/osullivan/tags","blobs_url":"https://api.github.com/repos/jpstroop/osullivan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpstroop/osullivan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpstroop/osullivan/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpstroop/osullivan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpstroop/osullivan/statuses/{sha}","languages_url":"https://api.github.com/repos/jpstroop/osullivan/languages","stargazers_url":"https://api.github.com/repos/jpstroop/osullivan/stargazers","contributors_url":"https://api.github.com/repos/jpstroop/osullivan/contributors","subscribers_url":"https://api.github.com/repos/jpstroop/osullivan/subscribers","subscription_url":"https://api.github.com/repos/jpstroop/osullivan/subscription","commits_url":"https://api.github.com/repos/jpstroop/osullivan/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpstroop/osullivan/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpstroop/osullivan/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpstroop/osullivan/issues/comments/{number}","contents_url":"https://api.github.com/repos/jpstroop/osullivan/contents/{+path}","compare_url":"https://api.github.com/repos/jpstroop/osullivan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpstroop/osullivan/merges","archive_url":"https://api.github.com/repos/jpstroop/osullivan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpstroop/osullivan/downloads","issues_url":"https://api.github.com/repos/jpstroop/osullivan/issues{/number}","pulls_url":"https://api.github.com/repos/jpstroop/osullivan/pulls{/number}","milestones_url":"https://api.github.com/repos/jpstroop/osullivan/milestones{/number}","notifications_url":"https://api.github.com/repos/jpstroop/osullivan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpstroop/osullivan/labels{/name}","releases_url":"https://api.github.com/repos/jpstroop/osullivan/releases{/id}","created_at":"2014-11-06T00:09:41Z","updated_at":"2014-11-06T00:25:12Z","pushed_at":"2014-11-10T19:23:13Z","git_url":"git://github.com/jpstroop/osullivan.git","ssh_url":"git@github.com:jpstroop/osullivan.git","clone_url":"https://github.com/jpstroop/osullivan.git","svn_url":"https://github.com/jpstroop/osullivan","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"development"}},"base":{"label":"jpstroop:development","ref":"development","sha":"d39069b99ea5eb6105c316dcfca222748e912a4c","user":{"login":"jpstroop","id":999701,"avatar_url":"https://avatars.githubusercontent.com/u/999701?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstroop","html_url":"https://github.com/jpstroop","followers_url":"https://api.github.com/users/jpstroop/followers","following_url":"https://api.github.com/users/jpstroop/following{/other_user}","gists_url":"https://api.github.com/users/jpstroop/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstroop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstroop/subscriptions","organizations_url":"https://api.github.com/users/jpstroop/orgs","repos_url":"https://api.github.com/users/jpstroop/repos","events_url":"https://api.github.com/users/jpstroop/events{/privacy}","received_events_url":"https://api.github.com/users/jpstroop/received_events","type":"User","site_admin":false},"repo":{"id":26245866,"name":"osullivan","full_name":"jpstroop/osullivan","owner":{"login":"jpstroop","id":999701,"avatar_url":"https://avatars.githubusercontent.com/u/999701?v=3","gravatar_id":"","url":"https://api.github.com/users/jpstroop","html_url":"https://github.com/jpstroop","followers_url":"https://api.github.com/users/jpstroop/followers","following_url":"https://api.github.com/users/jpstroop/following{/other_user}","gists_url":"https://api.github.com/users/jpstroop/gists{/gist_id}","starred_url":"https://api.github.com/users/jpstroop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpstroop/subscriptions","organizations_url":"https://api.github.com/users/jpstroop/orgs","repos_url":"https://api.github.com/users/jpstroop/repos","events_url":"https://api.github.com/users/jpstroop/events{/privacy}","received_events_url":"https://api.github.com/users/jpstroop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpstroop/osullivan","description":"API for creating IIIF Manifests","fork":false,"url":"https://api.github.com/repos/jpstroop/osullivan","forks_url":"https://api.github.com/repos/jpstroop/osullivan/forks","keys_url":"https://api.github.com/repos/jpstroop/osullivan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpstroop/osullivan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpstroop/osullivan/teams","hooks_url":"https://api.github.com/repos/jpstroop/osullivan/hooks","issue_events_url":"https://api.github.com/repos/jpstroop/osullivan/issues/events{/number}","events_url":"https://api.github.com/repos/jpstroop/osullivan/events","assignees_url":"https://api.github.com/repos/jpstroop/osullivan/assignees{/user}","branches_url":"https://api.github.com/repos/jpstroop/osullivan/branches{/branch}","tags_url":"https://api.github.com/repos/jpstroop/osullivan/tags","blobs_url":"https://api.github.com/repos/jpstroop/osullivan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpstroop/osullivan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpstroop/osullivan/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpstroop/osullivan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpstroop/osullivan/statuses/{sha}","languages_url":"https://api.github.com/repos/jpstroop/osullivan/languages","stargazers_url":"https://api.github.com/repos/jpstroop/osullivan/stargazers","contributors_url":"https://api.github.com/repos/jpstroop/osullivan/contributors","subscribers_url":"https://api.github.com/repos/jpstroop/osullivan/subscribers","subscription_url":"https://api.github.com/repos/jpstroop/osullivan/subscription","commits_url":"https://api.github.com/repos/jpstroop/osullivan/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpstroop/osullivan/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpstroop/osullivan/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpstroop/osullivan/issues/comments/{number}","contents_url":"https://api.github.com/repos/jpstroop/osullivan/contents/{+path}","compare_url":"https://api.github.com/repos/jpstroop/osullivan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpstroop/osullivan/merges","archive_url":"https://api.github.com/repos/jpstroop/osullivan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpstroop/osullivan/downloads","issues_url":"https://api.github.com/repos/jpstroop/osullivan/issues{/number}","pulls_url":"https://api.github.com/repos/jpstroop/osullivan/pulls{/number}","milestones_url":"https://api.github.com/repos/jpstroop/osullivan/milestones{/number}","notifications_url":"https://api.github.com/repos/jpstroop/osullivan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpstroop/osullivan/labels{/name}","releases_url":"https://api.github.com/repos/jpstroop/osullivan/releases{/id}","created_at":"2014-11-06T00:09:41Z","updated_at":"2014-11-06T00:25:12Z","pushed_at":"2014-11-10T19:23:13Z","git_url":"git://github.com/jpstroop/osullivan.git","ssh_url":"git@github.com:jpstroop/osullivan.git","clone_url":"https://github.com/jpstroop/osullivan.git","svn_url":"https://github.com/jpstroop/osullivan","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/jpstroop/osullivan/pulls/16"},"html":{"href":"https://github.com/jpstroop/osullivan/pull/16"},"issue":{"href":"https://api.github.com/repos/jpstroop/osullivan/issues/16"},"comments":{"href":"https://api.github.com/repos/jpstroop/osullivan/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/jpstroop/osullivan/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/jpstroop/osullivan/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jpstroop/osullivan/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/jpstroop/osullivan/statuses/618ad56d1eb3c2eb62d0a37bbf70caae2091b7a5"}}}}