Sha256: 724f6865b1950c87011fca883d594b5fe0b1eabfaed5d2c4165b135c2cfe6d85

Contents?: true

Size: 887 Bytes

Versions: 2

Compression:

Stored size: 887 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "SmsNotify MessageStatus" do
  it "should not have attributes that do not describe a message status" do
    SmsNotify::MessageStatus.new({"Foo"=>'bar'}).respond_to?('foo').should be false
  end

  it "should have attributes that describe a message status" do
    SmsNotify::MessageStatus.new({"StatusCode"=>'6'}).status_code.should == '6'
  end

  describe "fatal_error?" do
    it "should return true when the status_code describes a message that will not be delivered" do
      status = SmsNotify::MessageStatus.new({"StatusCode"=>'3'})
      status.fatal_error?.should be true
    end

    it "should return false when the status_code describes a message that will be delivered" do
      status = SmsNotify::MessageStatus.new({"StatusCode"=>'5'})
      status.fatal_error?.should be false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cdyne-sms-notify-1.0.6 spec/message_status_spec.rb
cdyne-sms-notify-1.0.4 spec/message_status_spec.rb