Sha256: 2ff15ba15645a44a0b66f9ede846b64db074063b107160c3c2a878985de919af

Contents?: true

Size: 794 Bytes

Versions: 4

Compression:

Stored size: 794 Bytes

Contents

require 'test/unit'
require 'shoulda'
require File.join(File.dirname(__FILE__), *%w[.. lib clickatell utility])

class CliOptionsTest < Test::Unit::TestCase
  
  context "Sending a message" do
    should "allow single recipients" do
      options = Clickatell::Utility::Options.parse(%w{07944123456 testing})
      assert_equal %w{07944123456}, options.recipient
    end
    
    should "allow multiple, comma-separated recipients" do
      options = Clickatell::Utility::Options.parse(%w{07944123456,07944123457 testing})
      assert_equal %w{07944123456 07944123457}, options.recipient
    end
  end
  
  context "Checking balance" do
    should "not require a recipient" do
      options = Clickatell::Utility::Options.parse(%w{-b})
      assert_nil options.recipient
    end  
  end
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
clickatell-0.8.1 spec/cli_options_test.rb
clickatell-0.8.0 spec/cli_options_test.rb
clickatell-ruby19-0.7.1 spec/cli_options_test.rb
clickatell-0.7.1 spec/cli_options_test.rb