Sha256: b52d74028b7832a215e71233e00104ceb57b003ec52ef5955c491c5e4610c6bb
Contents?: true
Size: 1.32 KB
Versions: 12
Compression:
Stored size: 1.32 KB
Contents
shared_examples_for "collection of resources" do context "resource found" do before do stub_get(resource_path). to_return(:body => fixture(fixture_dir), :status => 200, :headers => {:content_type => "application/json; charset=utf-8"}) end it "should fail to get resource without username" do github.user, github.repo = nil, nil expect { github.issues.milestones nil, repo }.to raise_error(ArgumentError) end it "should get the resources" do github.send *method_chain, user, repo a_get(resource_path).should have_been_made end it "should return array of resources" do milestones = github.issues.milestones user, repo milestones.should be_an Array milestones.should have(1).items end it "should be a mash type" do milestones = github.issues.milestones user, repo milestones.first.should be_a Hashie::Mash end it "should get issue information" do milestones = github.issues.milestones user, repo milestones.first.title.should == 'v1.0' end it "should yield to a block" do github.issues.should_receive(:milestones).with(user, repo).and_yield('web') github.issues.milestones(user, repo) { |param| 'web' }.should == 'web' end end end
Version data entries
12 entries across 12 versions & 1 rubygems