Sha256: c86ddca034ab841470fb83049ed6ac5dc0371e37a5162455f6381bf725059c53

Contents?: true

Size: 583 Bytes

Versions: 15

Compression:

Stored size: 583 Bytes

Contents

require 'test_helper'

class ErrorTest < Test::Unit::TestCase

  context 'Initialization' do

    setup do
      @code = rand(1e3)
      @message = random_string
    end

    should 'accept a hash with error_code and error_message' do
      e = TextMagic::API::Error.new('error_code' => @code, 'error_message' => @message)
      e.code.should == @code
      e.message.should == @message
    end

    should 'accept error_code and error_message' do
      e = TextMagic::API::Error.new(@code, @message)
      e.code.should == @code
      e.message.should == @message
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
bobes-textmagic-0.2.0 test/test_error.rb
bobes-textmagic-0.2.1 test/test_error.rb
bobes-textmagic-0.2.2 test/test_error.rb
bobes-textmagic-0.2.3 test/test_error.rb
bobes-textmagic-0.3.0 test/test_error.rb
bobes-textmagic-0.3.1 test/test_error.rb
bobes-textmagic-0.3.2 test/test_error.rb
bobes-textmagic-0.3.3 test/test_error.rb
textmagic-0.2.2 test/test_error.rb
textmagic-0.3.3 test/test_error.rb
textmagic-0.2.1 test/test_error.rb
textmagic-0.3.0 test/test_error.rb
textmagic-0.3.1 test/test_error.rb
textmagic-0.3.2 test/test_error.rb
textmagic-0.2.0 test/test_error.rb