Sha256: 2ec18f0e7e12c1ab21e057ffce606d53c0cc2a8bc512afbc3183339a0ff72573

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

require "spec_helper"
require "rspec/expectations"
require "rspec/mocks"

describe Lita::Handlers::Whoami, lita_handler: true do
  it "will assign a person a descriptior." do
    send_command("taylor is a bad programmer")
    expect(replies).to_not be_empty
    expect(replies.last).to eq "Okay, taylor is a bad programmer!"
  end

  it "Can tell you what people are." do
    send_command("taylor is a bad programmer")
    send_command("who is taylor")

    expect(replies.last).to eq "taylor is a bad programmer"
    expect(replies.count).to eq 2
  end

  it "Can unassign a descriptior from someone." do
    send_command("taylor is a bad programmer")
    send_command("who is taylor")

    expect(replies.last).to eq "taylor is a bad programmer"
    expect(replies.count).to eq 2

    send_command("taylor isn't a bad programmer")
    expect(replies.last).to eq "Okay, taylor is not a bad programmer."
    expect(replies.count).to eq 3

    send_command("who is taylor")
    expect(replies.last).to eq "taylor is "
  end

  it "Can describe everyone" do
    send_command("taylor is a bad programmer")
    send_command("danny is a mediocre programmer")

    send_command("I don't know who anyone is")
    expect(replies.last).to include 'taylor is a bad programmer'
    expect(replies.last).to include 'danny is a mediocre programmer'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lita-whoami-0.1.4 spec/lita/handlers/whoami_spec.rb
lita-whoami-0.1.3 spec/lita/handlers/whoami_spec.rb