spec/github/activity/events/issue_spec.rb in github_api-0.8.0 vs spec/github/activity/events/issue_spec.rb in github_api-0.8.1

- old
+ new

@@ -26,38 +26,26 @@ it "should get the resources" do subject.issue user, repo a_get(request_path).should have_been_made end - it "should return array of resources" do - events = subject.issue user, repo - events.should be_an Array - events.should have(1).items + it_should_behave_like 'an array of resources' do + let(:requestable) { subject.issue user, repo } end - it "should be a mash type" do - events = subject.issue user, repo - events.first.should be_a Hashie::Mash - end - it "should get event information" do events = subject.issue user, repo events.first.type.should == 'Event' end it "should yield to a block" do - subject.should_receive(:issue).with(user, repo).and_yield('web') - subject.issue(user, repo) { |param| 'web' } + yielded = [] + result = subject.issue(user, repo) { |obj| yielded << obj } + yielded.should == result end end - context "resource not found" do - let(:body) { '' } - let(:status) { [404, "Not Found"] } - - it "should return 404 with a message 'Not Found'" do - expect { - subject.issue user, repo - }.to raise_error(Github::Error::NotFound) - end + it_should_behave_like 'request failure' do + let(:requestable) { subject.issue user, repo } end + end # issue