Sha256: e3fe30223c2939f5bd2822ef53f27ab0f002f164fce236739fc69ceca07cc4b6

Contents?: true

Size: 906 Bytes

Versions: 5

Compression:

Stored size: 906 Bytes

Contents

require 'spec_helper'

describe StackExchange::StackOverflow::Statistics do

  before do
    StackExchange::StackOverflow::Client.config
  end

  describe 'when querying for statistics' do
    it "should return the stack overflow's statistics" do
      response = StackOverflow::Statistics.all
      response.total_questions.should == 692539
      response.total_unanswered.should == 107245
      response.total_answers.should == 1938135
      response.total_comments.should == 2724322
      response.total_votes.should == 6817279
      response.total_badges.should == 699700
      response.total_users.should == 247683
      response.questions_per_minute.should == 1.78
      response.answers_per_minute.should == 3.71
      response.badges_per_minute.should == 1.58
      response.api_version['version'].should == "0.8"
      response.api_version['revision'].should == "1.0.1234.5678"
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pilha-0.1.6 spec/pilha/stack_overflow/statistics_spec.rb
pilha-0.1.5 spec/pilha/stack_overflow/statistics_spec.rb
pilha-0.1.3 spec/pilha/stack_overflow/statistics_spec.rb
pilha-0.1.2 spec/pilha/stack_overflow/statistics_spec.rb
pilha-0.1.1 spec/pilha/stack_overflow/statistics_spec.rb