Sha256: 86679d7db4116450e5cc896b71855de738ad6baad0d139253b622f1a46d7efcf

Contents?: true

Size: 797 Bytes

Versions: 4

Compression:

Stored size: 797 Bytes

Contents

require 'spec_helper'

describe Popularity::Github do
  context "non-github url" do
    use_vcr_cassette "github-invalid"

    subject {
      Popularity::Github.new('http://google.com')
    }

    it "should be invalid" do
      expect(subject.valid?).to eq(false)
    end

    it "should have no response" do
      expect(subject.response).to eq(false)
    end
  end

  context "github url" do
    use_vcr_cassette "github-valid"

    subject {
      Popularity::Github.new('http://github.com/jkeen/tracking_number')
    }

    it "should be valid" do
      expect(subject.valid?).to eq(true)
    end

    it "should have response" do
      expect(subject.response).to_not eq(false)
    end

    it "should have correct number of stars" do
      expect(18).to eq(subject.stars)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
popularity-0.2.1 spec/github_spec.rb
popularity-0.1.1 spec/github_spec.rb
popularity-0.1.0 spec/github_spec.rb
popularity-0.0.1 spec/github_spec.rb