Sha256: 24df6a164ad8f85b76cbd6f484506ffcf2b8ee31ee50ee52bf8c28415de5c01a

Contents?: true

Size: 706 Bytes

Versions: 7

Compression:

Stored size: 706 Bytes

Contents

require_relative '../spec_helper'

describe Kanpachi::DSL::Error do
  before do
    Kanpachi::APIList.clear
  end

  subject do
    Kanpachi::DSL::Error.new(not_found_error, api_dsl)
  end

  let(:not_found_error) do
    Kanpachi::Error.new(:not_found_error)
  end

  let(:api_dsl) do
    Kanpachi::DSL::API.new(my_api)
  end

  let(:my_api) do
    extend Kanpachi::DSL
    api 'MyApp' do
      title 'My App'
    end
  end

  it 'sets the description' do
    subject.description 'Just for testing'
    not_found_error.description.must_equal 'Just for testing'
  end

  it 'sets the response' do
    subject.response do
      status 201
    end
    not_found_error.response.status.must_equal 201
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kanpachi-0.0.7 spec/dsl/error_spec.rb
kanpachi-0.0.6 spec/dsl/error_spec.rb
kanpachi-0.0.5 spec/dsl/error_spec.rb
kanpachi-0.0.4 spec/dsl/error_spec.rb
kanpachi-0.0.3 spec/dsl/error_spec.rb
kanpachi-0.0.2 spec/dsl/error_spec.rb
kanpachi-0.0.1 spec/dsl/error_spec.rb