Sha256: cfcbc0c5468c863fe6bb523dec1082fb2378c335dcf169c3a4604951c0a769d7

Contents?: true

Size: 588 Bytes

Versions: 3

Compression:

Stored size: 588 Bytes

Contents

require "test_helper"

describe "Error" do

  describe "Initialization" do

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
textmagic-0.7.1 test/test_error.rb
textmagic-0.7.0 test/test_error.rb
textmagic-0.6.0 test/test_error.rb