Sha256: 6e9860fbeb721501a1cbb95cca1e65be2980efb3eaf79b68508bf6a68c064040

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe Cinch::Plugins::UrbanDict do
  include Cinch::Test

  before(:all) do
    @bot = make_bot(Cinch::Plugins::UrbanDict)
  end

  it 'should allow users to search for words' do
    msg = get_replies(make_message(@bot, '!ud dork')).first
    expect(msg.text).to match('Someone who has odd interests')
  end

  it 'should not return nil for valid searches' do
    msg = get_replies(make_message(@bot, '!ud dork')).first
    expect(msg.text).to_not be_nil
  end

  it 'should return an error for invalid searches' do
    msg = get_replies(make_message(@bot, '!ud 7zJ6t8rT8p384My')).first
    expect(msg.text)
    .to match('test: Urban Dictionary ∴ 7zJ6t8rT8p384My: No definition available.')
  end

  it 'should not return multiple lines for a definition with breaks' do
    response = get_replies(make_message(@bot, '!ud dong')).first.text
    expect(response).to_not match('<br')
    expect(response).to_not match('\r')
    expect(response).to_not match('\n')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cinch-urbandict-1.0.5 spec/cinch-urbandict_spec.rb
cinch-urbandict-1.0.4 spec/cinch-urbandict_spec.rb