Sha256: aadb211a45748f5814205c0a7e55a52617f0345796aad75e57ca4c972baa612b

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

require 'teststrap'
require 'contributions/github_api'

context "Contributions::GithubAPI" do
  context ".forks" do
    setup { Contributions::GithubAPI.forks('charlietanksley') }

    context "gets a list of all the forks" do
      setup { topic.count }
      denies_topic.equals 0
    end

    context "gets the original names, not the name of the fork" do
      denies_topic.includes 'charlietanksley/riot'
      asserts_topic.includes 'thumblemonks/riot'
    end
  end

  context ".repos gets all the repositories when there are less than 100" do
    setup { Contributions::GithubAPI.repos('rubinius').count }
    
    asserts_topic.equals JSON.parse(open("https://api.github.com/users/rubinius") { |f| f.read })["public_repos"]
  end

  # Pending
  context ".repos gets all the repositories when there are tons" do
    # setup { Contributions::GithubAPI.repos('vim-scripts').count }
    
    # asserts_topic.equals JSON.parse(open("https://api.github.com/users/vim-scripts") { |f| f.read })["public_repos"]
  end

  context ".name returns the name of the user" do
    setup { Contributions::GithubAPI.name('charlietanksley') }
    asserts_topic.equals 'Charlie Tanksley'
  end

  context ".parent returns the name of the forked repository" do
    setup { Contributions::GithubAPI.parent('charlietanksley/riot') }
    asserts_topic.equals 'thumblemonks/riot'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
contributions-0.2.0 test/github_api_test.rb
contributions-0.1.2 test/github_api_test.rb
contributions-0.1.1 test/github_api_test.rb