Sha256: 22b249fe967090c7a65ced02c1fd25692ba6a3f6dec0f0c07c60e28bcbce5268

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

describe Cinch::Plugins::Calculate do

  include Cinch::Test

  before(:each) do
    @bot = make_bot(Cinch::Plugins::Calculate)
  end

  describe 'configuration' do
    it 'should handle units binary not existing gracefully' do
      @bot = make_bot(Cinch::Plugins::Calculate, { :units_path => '/usr/baddir/units' })
      msg = make_message(@bot, '!math 2 + 2')

      get_replies(msg).last.chomp.
        should == 'test: Sorry, I can\'t do that'
    end
  end

  it 'should allow basic math' do
    msg = make_message(@bot, '!math 2 + 2')

    get_replies(msg).last.chomp.
      should == 'test: 4'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cinch-calculate-1.0.0 spec/cinch-calculate_spec.rb