Sha256: 970bd337c1f9cd6945ceef2a213a22833465d1f7d3a7aa5c29a65f02588e29e0
Contents?: true
Size: 1.64 KB
Versions: 17
Compression:
Stored size: 1.64 KB
Contents
# -*- encoding: utf-8 -*- require 'helper' describe Octokit::Repository do context "when passed a string containg a slash" do before do @repository = Octokit::Repository.new("sferik/octokit") end it "should set the repository name and username" do @repository.name.should == "octokit" @repository.username.should == "sferik" end it "should respond to repo and user" do @repository.repo.should == "octokit" @repository.user.should == "sferik" end it "should render slug as string" do @repository.slug.should == "sferik/octokit" @repository.to_s.should == @repository.slug end it "should render url as string" do @repository.url.should == 'https://github.com/sferik/octokit' end end context "when passed a hash" do it "should set the repository name and username" do repository = Octokit::Repository.new({:username => 'sferik', :name => 'octokit'}) repository.name.should == "octokit" repository.username.should == "sferik" end end context "when passed a Repo" do it "should set the repository name and username" do repository = Octokit::Repository.new(Octokit::Repository.new('sferik/octokit')) repository.name.should == "octokit" repository.username.should == "sferik" repository.url.should == 'https://github.com/sferik/octokit' end end context "when given a URL" do it "should set the repository name and username" do repository = Octokit::Repository.from_url("https://github.com/sferik/octokit") repository.name.should == "octokit" repository.username.should == "sferik" end end end
Version data entries
17 entries across 17 versions & 1 rubygems