Sha256: f4996b35d57e5258c4cc0d9c16f3e0949f3948772f9bd191f410ffa3c3dde5a8

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

require_relative '../../spec_helper'

describe Octonore::Template do

  describe "default attributes" do

    it "should have httparty methods" do
      Octonore::Template.should include(HTTParty)
    end

    it "should have the base url set to the Github API gitignore endpoint" do
      Octonore::Template.base_uri.should eq('https://api.github.com/gitignore')
    end

  end

  describe "default instance attributes" do

    let(:template) { Octonore::Template.new('C') }

    before { VCR.insert_cassette 'template', :record => :new_episodes }

    after { VCR.eject_cassette }

    it "should have a name attribute" do
      template.should respond_to :name
    end

    it "should have a source attribute" do
      template.should respond_to :source
    end

    it "should have the right name" do
      template.name.should eq('C')
    end

  end

  describe "GET template" do

    let(:template) { Octonore::Template.new('C') }

    before { VCR.insert_cassette 'template', :record => :new_episodes }

    after { VCR.eject_cassette }

    it "should have an update method" do
      template.should respond_to :update
    end

    it "should be able to refresh data from Github" do
      template.source = nil
      template.update
      template.source.should_not equal nil
    end

    it "should raise an error if template doesn't exist" do
      expect {
        bad_template = Octonore::Template.new('invalid') }.to raise_error
    end
    
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
octonore-0.0.3 spec/lib/octonore/template_spec.rb