Sha256: bf7c631d26fbdc1b1fb9adac10a022c665aa38aab323b0e9336f86f3b23bd5c7

Contents?: true

Size: 995 Bytes

Versions: 2

Compression:

Stored size: 995 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'
require File.dirname(__FILE__) + '/../lib/clickatell/utility'

describe "CLI options" do

  context "when sending a message" do
    it "should allow single recipients" do
      options = Clickatell::Utility::Options.parse(%w{07944123456 testing})
      options.recipient.should include("07944123456")
    end

    it "should allow multiple, comma-separated recipients" do
      options = Clickatell::Utility::Options.parse(%w{07944123456,07944123457 testing})
      options.recipient.should include(*%w{07944123456 07944123457})
    end

    it "should strip + symbols from the beginning of numbers" do
      options = Clickatell::Utility::Options.parse(%w{+447944123456 testing})
      options.recipient.should include("447944123456")
    end
  end

  context "when checking balance" do
    it "should not require a recipient" do
      options = Clickatell::Utility::Options.parse(%w{-b})
      options.recipient.should be_nil
    end
  end

end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
lookout-clickatell-0.8.3 spec/cli_options_spec.rb
clickatell-0.8.2 spec/cli_options_spec.rb