Sha256: 06606ec191294995eb06c72b786b0c79b225593c1448f03ea516a1da990c373e

Contents?: true

Size: 999 Bytes

Versions: 24

Compression:

Stored size: 999 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'helper'

describe Octokit::Gist do

  context "when given a URL" do
    it "should set the id" do
      gist = Octokit::Gist.from_url("https://gist.github.com/12345")
      gist.id.should == '12345'
    end
  end

  context "when passed a string ID" do
    before do
      @gist = Octokit::Gist.new('12345')
    end

    it "should set the gist ID" do
      @gist.id.should == '12345'
    end

    it "should set the url" do
      @gist.url.should == 'https://gist.github.com/12345'
    end

    it "should render id as string" do
      @gist.to_s.should == @gist.id
    end
  end

  context "when passed a Fixnum ID" do
    before do
      @gist = Octokit::Gist.new(12345)
    end

    it "should set the gist ID as a string" do
      @gist.id.should == '12345'
    end

    it "should set the url" do
      @gist.url.should == 'https://gist.github.com/12345'
    end

    it "should render id as string" do
      @gist.to_s.should == @gist.id
    end
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
octokit-1.17.0 spec/octokit/gist_spec.rb
octokit-1.15.1 spec/octokit/gist_spec.rb
octokit-1.15.0 spec/octokit/gist_spec.rb
octokit-1.14.0 spec/octokit/gist_spec.rb
octokit-1.13.0 spec/octokit/gist_spec.rb
octokit-1.12.0 spec/octokit/gist_spec.rb
octokit-1.11.0 spec/octokit/gist_spec.rb
octokit-1.10.0 spec/octokit/gist_spec.rb
octokit-1.9.4 spec/octokit/gist_spec.rb
octokit-1.9.3 spec/octokit/gist_spec.rb
octokit-1.9.2 spec/octokit/gist_spec.rb
octokit-1.9.1 spec/octokit/gist_spec.rb
octokit-1.8.1 spec/octokit/gist_spec.rb
octokit-1.8.0 spec/octokit/gist_spec.rb
octokit-1.7.0 spec/octokit/gist_spec.rb
octokit-1.6.1 spec/octokit/gist_spec.rb
octokit-1.6.0 spec/octokit/gist_spec.rb
octokit-1.5.0 spec/octokit/gist_spec.rb
octokit-1.4.0 spec/octokit/gist_spec.rb
octokit-1.3.0 spec/octokit/gist_spec.rb