Sha256: b5917dea828020a0f74311084103473e0295cbaa77e363b2d1e059e089e12b06
Contents?: true
Size: 1.34 KB
Versions: 7
Compression:
Stored size: 1.34 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Github::Gitignore, '#get' do let(:template) { 'Ruby' } let(:request_path) { "/gitignore/templates/#{template}" } before { stub_get(request_path).to_return(:body => body, :status => status, :headers => {:accept => accept }) } after { reset_authentication_for(subject) } context "resource found" do let(:body) { fixture("gitignore/template.json") } let(:status) { 200 } let(:accept) { "application/json; charset=utf-8" } it { should respond_to :find } it "should fail to get resource without key" do expect { subject.get }.to raise_error(ArgumentError) end it "should get the resource" do subject.get template a_get(request_path).should have_been_made end it "should get key information" do temp = subject.get template temp.name.should == "C" end end context 'raw content' do let(:body) { fixture("gitignore/template_raw") } let(:status) { 200 } let(:accept) { 'application/vnd.github.raw' } it "should get the resource" do subject.get template, 'mime' => 'application/vnd.github.raw' a_get(request_path).should have_been_made end end it_should_behave_like 'request failure' do let(:accept) { 'application/json' } let(:requestable) { subject.get template } end end # get
Version data entries
7 entries across 7 versions & 1 rubygems