{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments/50623271","id":50623271,"diff_hunk":"@@ -0,0 +1,134 @@\n+require 'airport'\n+\n+describe Airport do\n+\n+  let(:plane) {double(:plane)}\n+  let(:plane2) {double(:plane)}\n+  #let(:storm_weather) {double(:weather, stormy?: true)}\n+  #let(:calm_weather) {double(:weather, stormy?: false)}\n+\n+  describe '#initialize' do\n+\n+    it 'initializes with a default capacity' do\n+      expect(subject.capacity).to eq(Airport::DEFAULT_CAPACITY)\n+    end\n+\n+    it 'initializes with variable capacity' do\n+      airport = Airport.new 49\n+      expect(airport.capacity).to eq 49\n+    end\n+\n+    it 'can only land num of planes equal to capacity' do\n+      allow(plane).to receive(:to_land)\n+      nr = rand(0..100)\n+      subject = Airport.new nr\n+      allow(subject).to receive(:stormy?) {false}\n+      nr.times{subject.land(plane)}\n+      msg = 'Landing is not permitted as airport is full'\n+      expect{subject.land(plane)}.to raise_error msg\n+    end\n+  end\n+\n+  context 'changing capacity' do\n+    it 'changing capacity can be done after initialization' do\n+        subject = Airport.new 30\n+        subject.change_capacity(50)\n+        expect(subject.capacity).to eq(50)\n+    end\n+\n+    it 'cannot change capacity if new capacity is lower than num of planes' do\n+      allow(plane).to receive(:to_land)\n+      subject = Airport.new 30\n+      allow(subject).to receive(:stormy?) {false}\n+      30.times{subject.land(plane)}\n+      msg = 'New capacity is lower than number of planes in airport'\n+      expect{subject.change_capacity(20)}.to raise_error msg\n+    end\n+  end\n+\n+  context 'landing a plane' do\n+    before (:each) do\n+      allow(plane).to receive(:to_land)\n+      allow(subject).to receive(:stormy?) { false }\n+    end\n+\n+    it 'instructs plane to land' do\n+      expect(plane).to respond_to(:to_land)\n+      subject.land(plane)\n+    end\n+\n+    it 'lands a plane' do\n+      subject.land(plane)\n+      expect(subject.planes).to include plane\n+    end\n+\n+    it 'confirms that plane is at airport' do\n+      subject.land(plane)\n+      expect(subject.contains?(plane)).to eq true\n+    end\n+\n+    it 'will only land if it is in the air' do\n+      pending('edge case')\n+      edgecase\n+    end\n+\n+    it 'plane is prevented from landing in stormy weather' do\n+      allow(subject).to receive(:stormy?) { true }\n+      msg = 'Landing is not allowed in stormy weather'\n+      expect{subject.land(plane)}.to raise_error msg\n+    end\n+\n+    it 'cannot happen if airport is full' do\n+      Airport::DEFAULT_CAPACITY.times {subject.land(plane)}\n+      msg = 'Landing is not permitted as airport is full'\n+      expect{subject.land(plane)}.to raise_error msg\n+    end\n+  end\n+\n+  context 'take-off' do\n+    before (:each) do\n+      allow(plane).to receive(:to_land)\n+      allow(plane).to receive(:take_off)\n+      allow(plane).to receive(:took_off)\n+      allow(subject).to receive(:stormy?) {false}\n+      subject.land(plane)\n+    end\n+\n+    it 'instructs plane to take_off' do\n+      expect(plane).to respond_to(:took_off)\n+      subject.take_off(plane)\n+    end\n+\n+    it 'plane not at airport after takeoff' do\n+      subject.take_off(plane)\n+      expect(subject.planes).not_to include plane\n+    end\n+\n+    it 'a specific plane takes-off' do\n+      allow(plane2).to receive(:to_land)\n+      subject.land(plane2)\n+      subject.take_off(plane)\n+      expect(subject.planes).not_to include plane\n+    end\n+\n+    it 'confirmed that specific plane is not at airport' do\n+      allow(plane2).to receive(:to_land)\n+      subject.land(plane2)\n+      subject.take_off(plane)\n+      expect(subject.contains?(plane)).to eq false\n+    end\n+\n+    it 'plane is prevented from taking off in stormy weather' do\n+      allow(subject).to receive(:stormy?) {true}\n+      expect{subject.take_off(plane)}.to raise_error('Take-off is not allowed in stormy weather')","path":"spec/airport_spec.rb","position":123,"original_position":123,"commit_id":"3fefb1a480408ee1c1e481c8a8923260ecebe90d","original_commit_id":"3fefb1a480408ee1c1e481c8a8923260ecebe90d","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":"Metrics/LineLength: Line is too long. [97/80] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)","created_at":"2016-01-23T18:05:03Z","updated_at":"2016-01-23T18:05:03Z","html_url":"https://github.com/makersacademy/airport_challenge/pull/277#discussion_r50623271","pull_request_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments/50623271"},"html":{"href":"https://github.com/makersacademy/airport_challenge/pull/277#discussion_r50623271"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277","id":56976200,"html_url":"https://github.com/makersacademy/airport_challenge/pull/277","diff_url":"https://github.com/makersacademy/airport_challenge/pull/277.diff","patch_url":"https://github.com/makersacademy/airport_challenge/pull/277.patch","issue_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/277","number":277,"state":"open","locked":false,"title":"started airport challenge","user":{"login":"eilw","id":10661267,"avatar_url":"https://avatars.githubusercontent.com/u/10661267?v=3","gravatar_id":"","url":"https://api.github.com/users/eilw","html_url":"https://github.com/eilw","followers_url":"https://api.github.com/users/eilw/followers","following_url":"https://api.github.com/users/eilw/following{/other_user}","gists_url":"https://api.github.com/users/eilw/gists{/gist_id}","starred_url":"https://api.github.com/users/eilw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eilw/subscriptions","organizations_url":"https://api.github.com/users/eilw/orgs","repos_url":"https://api.github.com/users/eilw/repos","events_url":"https://api.github.com/users/eilw/events{/privacy}","received_events_url":"https://api.github.com/users/eilw/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-23T13:25:57Z","updated_at":"2016-01-23T18:05:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa74b9254409117fba13810413c281b06edda350","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277/commits","review_comments_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277/comments","review_comment_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/277/comments","statuses_url":"https://api.github.com/repos/makersacademy/airport_challenge/statuses/3fefb1a480408ee1c1e481c8a8923260ecebe90d","head":{"label":"eilw:master","ref":"master","sha":"3fefb1a480408ee1c1e481c8a8923260ecebe90d","user":{"login":"eilw","id":10661267,"avatar_url":"https://avatars.githubusercontent.com/u/10661267?v=3","gravatar_id":"","url":"https://api.github.com/users/eilw","html_url":"https://github.com/eilw","followers_url":"https://api.github.com/users/eilw/followers","following_url":"https://api.github.com/users/eilw/following{/other_user}","gists_url":"https://api.github.com/users/eilw/gists{/gist_id}","starred_url":"https://api.github.com/users/eilw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eilw/subscriptions","organizations_url":"https://api.github.com/users/eilw/orgs","repos_url":"https://api.github.com/users/eilw/repos","events_url":"https://api.github.com/users/eilw/events{/privacy}","received_events_url":"https://api.github.com/users/eilw/received_events","type":"User","site_admin":false},"repo":{"id":50239172,"name":"airport_challenge","full_name":"eilw/airport_challenge","owner":{"login":"eilw","id":10661267,"avatar_url":"https://avatars.githubusercontent.com/u/10661267?v=3","gravatar_id":"","url":"https://api.github.com/users/eilw","html_url":"https://github.com/eilw","followers_url":"https://api.github.com/users/eilw/followers","following_url":"https://api.github.com/users/eilw/following{/other_user}","gists_url":"https://api.github.com/users/eilw/gists{/gist_id}","starred_url":"https://api.github.com/users/eilw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eilw/subscriptions","organizations_url":"https://api.github.com/users/eilw/orgs","repos_url":"https://api.github.com/users/eilw/repos","events_url":"https://api.github.com/users/eilw/events{/privacy}","received_events_url":"https://api.github.com/users/eilw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eilw/airport_challenge","description":"Fly!","fork":true,"url":"https://api.github.com/repos/eilw/airport_challenge","forks_url":"https://api.github.com/repos/eilw/airport_challenge/forks","keys_url":"https://api.github.com/repos/eilw/airport_challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eilw/airport_challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eilw/airport_challenge/teams","hooks_url":"https://api.github.com/repos/eilw/airport_challenge/hooks","issue_events_url":"https://api.github.com/repos/eilw/airport_challenge/issues/events{/number}","events_url":"https://api.github.com/repos/eilw/airport_challenge/events","assignees_url":"https://api.github.com/repos/eilw/airport_challenge/assignees{/user}","branches_url":"https://api.github.com/repos/eilw/airport_challenge/branches{/branch}","tags_url":"https://api.github.com/repos/eilw/airport_challenge/tags","blobs_url":"https://api.github.com/repos/eilw/airport_challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eilw/airport_challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eilw/airport_challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/eilw/airport_challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eilw/airport_challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/eilw/airport_challenge/languages","stargazers_url":"https://api.github.com/repos/eilw/airport_challenge/stargazers","contributors_url":"https://api.github.com/repos/eilw/airport_challenge/contributors","subscribers_url":"https://api.github.com/repos/eilw/airport_challenge/subscribers","subscription_url":"https://api.github.com/repos/eilw/airport_challenge/subscription","commits_url":"https://api.github.com/repos/eilw/airport_challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/eilw/airport_challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/eilw/airport_challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/eilw/airport_challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/eilw/airport_challenge/contents/{+path}","compare_url":"https://api.github.com/repos/eilw/airport_challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eilw/airport_challenge/merges","archive_url":"https://api.github.com/repos/eilw/airport_challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eilw/airport_challenge/downloads","issues_url":"https://api.github.com/repos/eilw/airport_challenge/issues{/number}","pulls_url":"https://api.github.com/repos/eilw/airport_challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/eilw/airport_challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/eilw/airport_challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eilw/airport_challenge/labels{/name}","releases_url":"https://api.github.com/repos/eilw/airport_challenge/releases{/id}","deployments_url":"https://api.github.com/repos/eilw/airport_challenge/deployments","created_at":"2016-01-23T13:20:14Z","updated_at":"2016-01-23T13:20:15Z","pushed_at":"2016-01-23T18:04:58Z","git_url":"git://github.com/eilw/airport_challenge.git","ssh_url":"git@github.com:eilw/airport_challenge.git","clone_url":"https://github.com/eilw/airport_challenge.git","svn_url":"https://github.com/eilw/airport_challenge","homepage":"","size":94,"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":"makersacademy:master","ref":"master","sha":"3b2a5e2f27aa371bdcb3bc6c79d96cf1aee77e4b","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":27074983,"name":"airport_challenge","full_name":"makersacademy/airport_challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/airport_challenge","description":"Fly!","fork":false,"url":"https://api.github.com/repos/makersacademy/airport_challenge","forks_url":"https://api.github.com/repos/makersacademy/airport_challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/airport_challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/airport_challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/airport_challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/airport_challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/airport_challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/airport_challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/airport_challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/airport_challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/airport_challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/airport_challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/airport_challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/airport_challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/airport_challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/airport_challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/airport_challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/airport_challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/airport_challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/airport_challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/airport_challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/airport_challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/airport_challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/airport_challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/airport_challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/airport_challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/airport_challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/airport_challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/airport_challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/airport_challenge/releases{/id}","deployments_url":"https://api.github.com/repos/makersacademy/airport_challenge/deployments","created_at":"2014-11-24T12:30:39Z","updated_at":"2016-01-22T15:59:04Z","pushed_at":"2016-01-23T18:04:58Z","git_url":"git://github.com/makersacademy/airport_challenge.git","ssh_url":"git@github.com:makersacademy/airport_challenge.git","clone_url":"https://github.com/makersacademy/airport_challenge.git","svn_url":"https://github.com/makersacademy/airport_challenge","homepage":"","size":19895,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":258,"mirror_url":null,"open_issues_count":49,"forks":258,"open_issues":49,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277"},"html":{"href":"https://github.com/makersacademy/airport_challenge/pull/277"},"issue":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/issues/277"},"comments":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/issues/277/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/pulls/277/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/airport_challenge/statuses/3fefb1a480408ee1c1e481c8a8923260ecebe90d"}}}}