Sha256: fe17ae29a25b24882345660eb074dba61ff88ffe5a235789970d713f9c517314
Contents?: true
Size: 1.21 KB
Versions: 17
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true RSpec.describe Twitch::Bot::Message::UserMessage do it "recognizes a bot command" do message = described_class.new( text: "!command argument1", user: "tester", ) expect(message.command?).to be true end it "recognizes a specific bot command" do message = described_class.new( text: "!command argument1", user: "tester", ) expect(message.command_name?("command")).to be true end it "does not recognize normal text as a command" do message = described_class.new( text: "nocommand here", user: "tester", ) expect(message.command?).to be false end it "does not mistake text for a command" do message = described_class.new( text: "nocommand here", user: "tester", ) expect(message.command_name?("nocommand")).to be false end it "parses a bot command" do message = described_class.new( text: "!command argument1", user: "tester", ) expect(message.command).to eq "command" end it "does not return a command for normal text" do message = described_class.new( text: "nocommand here", user: "tester", ) expect(message.command).to be nil end end
Version data entries
17 entries across 17 versions & 1 rubygems