Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Expose Adapter#mention_format to Robot. Closes litaio#104.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycuadra committed Jun 5, 2015
1 parent 240ccd0 commit 33c55bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/lita/robot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class Robot

def_delegators :registry, :config, :adapters, :handlers, :hooks

# @!method mention_format(name)
# @see Lita::Adapter#mention_format
# @since 4.4.0
def_delegators :adapter, :mention_format

# @param registry [Lita::Registry] The registry for the robot's configuration and plugins.
def initialize(registry = Lita)
@registry = registry
Expand Down
4 changes: 4 additions & 0 deletions spec/lita/robot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
expect(subject.mention_name).to eq("wongo")
end

it "exposes Adapter#mention_format" do
expect(subject.mention_format(subject.mention_name)).to eq("Lita:")
end

context "with registered handlers" do
let(:handler1) { Class.new(Lita::Handler) { namespace :test } }
let(:handler2) { Class.new(Lita::Handler) { namespace :test } }
Expand Down

0 comments on commit 33c55bb

Please sign in to comment.