Permalink
Browse files

text, dont' paste

  • Loading branch information...
1 parent 333858f commit 8786f453654f1f0ff9392ebaba695f26896781d1 @langalex committed Jul 6, 2011
Showing with 5 additions and 5 deletions.
  1. +2 −2 lib/yobot/behaviors/weather.rb
  2. +3 −3 spec/yobot/behaviors/weather_spec.rb
@@ -7,15 +7,15 @@ def react(room, message)
city = message.sub(/^weather/, '').strip
if city.empty?
- room.paste('please name a city')
+ room.text('please name a city')
return
end
request = EventMachine::HttpRequest.new('http://www.google.com/ig/api')
http = request.get(query: { weather: city })
http.callback do
- room.paste(extract_weather(http.response)) {}
+ room.text(extract_weather(http.response)) {}
end
end
end
@@ -45,7 +45,7 @@
EventMachine::HttpRequest.should_not_receive(:new)
- room.should_receive(:paste).with("please name a city")
+ room.should_receive(:text).with("please name a city")
Yobot::Behaviors::Weather.new.react(room, 'weather')
end
@@ -59,7 +59,7 @@
http.stub(:callback).and_yield
http.stub(:response) { weather_xml }
- room.should_receive(:paste).with("Weather in Berlin, Berlin: 19°C, Clear, Humidity: 60%, Wind: NE at 2 mph")
+ room.should_receive(:text).with("Weather in Berlin, Berlin: 19°C, Clear, Humidity: 60%, Wind: NE at 2 mph")
Yobot::Behaviors::Weather.new.react(room, 'weather berlin')
end
@@ -73,7 +73,7 @@
http.stub(:callback).and_yield
http.stub(:response) { weather_error_xml }
- room.should_receive(:paste).with("couldn't fetch the weather information")
+ room.should_receive(:text).with("couldn't fetch the weather information")
Yobot::Behaviors::Weather.new.react(room, 'weather foobar')
end

0 comments on commit 8786f45

Please sign in to comment.