Sha256: ca52b8578f4ab2e6f56cca52269bb6bd4eec276276b26254aff9450211f8ef7a

Contents?: true

Size: 690 Bytes

Versions: 14

Compression:

Stored size: 690 Bytes

Contents

# Unit tests for Bandwidth::ApiError
describe Bandwidth::ApiError do
  describe '#initialize' do
    it 'initializes an instance of ApiError with message' do
      api_error = Bandwidth::ApiError.new({ message: 'test' })
      expect(api_error.message).to eq('test')
    end
  end

  describe '#to_s' do
    it 'returns message when to_s is called' do
      api_error = Bandwidth::ApiError.new('test')
      expect(api_error.to_s).to eq('test')
    end
  end

  describe '#message' do
    it 'returns default error message when none supplied' do
      api_error = Bandwidth::ApiError.new
      expect(api_error.message).to eq('Error message: the server returns an error')
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bandwidth-sdk-13.1.2 spec/unit/client/api_error_spec.rb
bandwidth-sdk-13.1.1 spec/unit/client/api_error_spec.rb
bandwidth-sdk-13.1.0 spec/unit/client/api_error_spec.rb
bandwidth-sdk-13.0.0 spec/unit/client/api_error_spec.rb
bandwidth-sdk-12.1.0 spec/unit/client/api_error_spec.rb
bandwidth-sdk-11.3.0 spec/api_error_spec.rb
bandwidth-sdk-11.2.0 spec/api_error_spec.rb
bandwidth-sdk-11.1.1 spec/api_error_spec.rb
bandwidth-sdk-11.1.0 spec/api_error_spec.rb
bandwidth-sdk-11.0.0 spec/api_error_spec.rb
bandwidth-sdk-11.0.0.pre.beta.4.0 spec/api_error_spec.rb
bandwidth-sdk-11.0.0.pre.beta.3.1 spec/api_error_spec.rb
bandwidth-sdk-11.0.0.pre.beta.3.0 spec/api_error_spec.rb
bandwidth-sdk-11.0.0.pre.beta.2.0 spec/api_error_spec.rb