Sha256: 4dae483c32f5a5a25de949b2384a2e19577539f032150c3995b246668346fdba

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require "spec_helper"

describe Lita::Handlers::AsciiArt, lita_handler: true do
  it { is_expected.to route_command("ascii FRIDAY").to(:ascii_from_text) }

  describe "#ascii_from_text" do
    it "responds with ASCII art generated from the given text" do
      send_command "ascii FRIDAY"
      expect(replies.first).to match("  _____ ____  ___ ____    _ __   __\n |  ___|  _ \\|_ _|  _ \\  / \\\\ \\ / /\n | |_  | |_) || || | | |/ _ \\\\ V / \n |  _| |  _ < | || |_| / ___ \\| |  \n |_|   |_| \\_\\___|____/_/   \\_\\_|  \n                                   ")
    end

    it "formats the response with a code block if the Slack adapter is in use" do
      registry.config.robot.adapter = :slack
      send_command 'ascii FRIDAY'
      expect(replies.first).to start_with("```")
      expect(replies.first).to end_with("```")
    end

    it "formats the response with a quote if the HipChat adapter is in use" do
      registry.config.robot.adapter = :hipchat
      send_command 'ascii FRIDAY'
      expect(replies.first).to start_with("/quote")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lita-ascii-art-0.1.0 spec/lita/handlers/ascii_art_spec.rb