Sha256: 26f0feedbf68e27aee853113e746f34627da37569c7f0c7cae0c5871ebd69556

Contents?: true

Size: 842 Bytes

Versions: 1

Compression:

Stored size: 842 Bytes

Contents

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

describe Cinch::Plugins::UrbanDict do

  before(:all) do
    @plugin = Cinch::Plugins::UrbanDict.new
  end

  it 'should allow users to search for words' do
    @plugin.send(:get_def, 'dork').
      should match('Someone who has odd interests')
  end

  it 'should not return nil for valid searches' do
    @plugin.send(:get_def, 'dong').
      should_not be_nil
  end

  it 'should return an error for invalid searches' do
    @plugin.send(:get_def, '7zJ6t8rT8p384My').
      should == "Urban Dictionary ∴ 7zJ6t8rT8p384My: No definition available."
  end

  it 'should not eturn multiple lines for a definition with breaks' do
    response = @plugin.send(:get_def, 'dong')
    response.should_not match("<br")
    response.should_not match("\r")
    response.should_not match("\n")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cinch-urbandict-1.0.0 spec/cinch-urbandict_spec.rb