Sha256: b9d9e49a038fb45ab7fa9dc89ab8841807c22431f66bd4c9aa72d995e449fd0c

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Error::ClientError do
  describe '#generate_message' do
    let(:error) { described_class.new('message') }
    let(:attributes) do
      {
        :problem => 'Oh no!',
        :summary => 'Fix this!',
        :resolution => 'Glue it!'
      }
    end

    it 'generates problem line' do
      error.generate_message(attributes).should include "Problem:\n Oh no!"
    end

    it 'generates summary line' do
      error.generate_message(attributes).should include "Summary:\n Fix this!"
    end

    it 'generates resolution line' do
      error.generate_message(attributes).should include "Resolution:\n Glue it!"
    end

    before do
      error.generate_message(attributes)
    end

    describe '#problem' do
      it 'returns problem' do
        error.problem.should eq attributes[:problem]
      end
    end

    describe '#summary' do
      it 'returns summary' do
        error.summary.should eq attributes[:summary]
      end
    end

    describe '#resolution' do
      it 'returns resolution' do
        error.resolution.should eq attributes[:resolution]
      end
    end
  end
end # Github::Error::ClientError

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/error/client_error_spec.rb
github_api-0.12.2 spec/github/error/client_error_spec.rb