spec/gems/client_spec.rb in gems-0.5.0 vs spec/gems/client_spec.rb in gems-0.5.1

- old
+ new

@@ -1,9 +1,9 @@ require 'helper' describe Gems::Client do - before do + after do Gems.reset end describe ".info" do before do @@ -98,10 +98,27 @@ end end end + describe ".most_downloaded" do + context "with nothing specified" do + before do + stub_get("/api/v1/downloads/all.yaml"). + to_return(:body => fixture("most_downloaded.yaml")) + end + + it "should return the most downloaded versions" do + most_downloaded = Gems.most_downloaded + a_get("/api/v1/downloads/all.yaml"). + should have_been_made + most_downloaded[:gems].first.first['full_name'].should == "abstract-1.0.0" + most_downloaded[:gems].first[1].should == 1 + end + end + end + describe ".downloads" do context "with no dates or version specified" do before do stub_get("/api/v1/gems/coulda.yaml"). @@ -406,6 +423,7 @@ should have_been_made unyank.should == "Successfully unyanked gem: gems (0.0.8)" end end end + end