From 361b194e641d13b849a289e74c8ac023288c069b Mon Sep 17 00:00:00 2001 From: "Jack Chen (chendo)" Date: Sat, 26 Nov 2011 01:27:57 +1100 Subject: [PATCH] Use a hash to pass data back to respond for flexibility --- lib/cora/plugin.rb | 2 +- spec/cora_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cora/plugin.rb b/lib/cora/plugin.rb index d8d8e24..6d0dda4 100644 --- a/lib/cora/plugin.rb +++ b/lib/cora/plugin.rb @@ -56,7 +56,7 @@ def ask(question) log "Ask: #{question}" f = Fiber.current - manager.respond(question, true) + manager.respond(question, prompt_for_response: true) manager.set_callback do |text| f.resume(text) end diff --git a/spec/cora_spec.rb b/spec/cora_spec.rb index d7fd245..05d22a0 100644 --- a/spec/cora_spec.rb +++ b/spec/cora_spec.rb @@ -98,7 +98,7 @@ class TestPlugin2 < Cora::Plugin # but since we're on 1.9, we can use Fibers. I think? it "gets input from the user and uses it intelligently" do - subject.should_receive(:respond).with("Who should I send it to?") + subject.should_receive(:respond).with("Who should I send it to?", prompt_for_response: true) subject.process("send message") subject.should_receive(:respond).with("Sending message to chendo") subject.process("chendo")