Sha256: 1a5dfa6385b6d2013dec0870b874c4daa4a0f9773ae97261bb2fd6cc7ed51b2b

Contents?: true

Size: 1.92 KB

Versions: 3

Compression:

Stored size: 1.92 KB

Contents

require "ashikawa-core/exceptions/no_collection_provided"
require "ashikawa-core/exceptions/client_error"
require "ashikawa-core/exceptions/client_error/bad_syntax"
require "ashikawa-core/exceptions/client_error/resource_not_found"
require "ashikawa-core/exceptions/client_error/resource_not_found/document_not_found"
require "ashikawa-core/exceptions/client_error/resource_not_found/collection_not_found"
require "ashikawa-core/exceptions/client_error/resource_not_found/index_not_found"
require "ashikawa-core/exceptions/server_error"
require "ashikawa-core/exceptions/server_error/json_error"

describe Ashikawa::Core::NoCollectionProvidedException do
  it "should have a good explanation" do
    subject.to_s.should include "without a collection"
  end
end

describe Ashikawa::Core::ClientError do
  it "should have a good explanation" do
    Ashikawa::Core::ClientError.new(411).to_s.should include "client"
  end
end

describe Ashikawa::Core::BadSyntax do
  it "should have a good explanation" do
    subject.to_s.should include "syntax"
  end
end

describe Ashikawa::Core::ResourceNotFound do
  it "should have a good explanation" do
    subject.to_s.should include "was not found"
  end
end

describe Ashikawa::Core::DocumentNotFoundException do
  it "should have a good explanation" do
    subject.to_s.should include "does not exist"
  end
end

describe Ashikawa::Core::CollectionNotFoundException do
  it "should have a good explanation" do
    subject.to_s.should include "does not exist"
  end
end

describe Ashikawa::Core::IndexNotFoundException do
  it "should have a good explanation" do
    subject.to_s.should include "does not exist"
  end
end

describe Ashikawa::Core::ServerError do
  it "should have a good explanation" do
    Ashikawa::Core::ServerError.new(511).to_s.should include "server"
  end
end

describe Ashikawa::Core::JsonError do
  it "should have a good explanation" do
    subject.to_s.should include "JSON from the server"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ashikawa-core-0.7.2 spec/unit/exception_spec.rb
ashikawa-core-0.7.1 spec/unit/exception_spec.rb
ashikawa-core-0.7.0 spec/unit/exception_spec.rb