spec/soupirc_spec.rb in muzang-plugins-1.1.4 vs spec/soupirc_spec.rb in muzang-plugins-1.1.5
- old
+ new
@@ -1,24 +1,26 @@
require 'spec_helper'
require 'muzang-plugins/muzang-soupirc'
-describe "Soup" do
- before do
- @bot = stub(:channels => ["#test"])
- @soup = SoupIRC.new(@bot, ["drugpl", "super_password"])
- @connection = ConnectionMock.new
- @message = OpenStruct.new({:channel => "#test", :message => "!soup http://example.com/image.jpg", :nick => "LTe"})
+module Muzang::Plugins
+ describe "Soup" do
+ before do
+ @bot = stub(:channels => ["#test"])
+ @soup = SoupIRC.new(@bot, ["drugpl", "super_password"])
+ @connection = ConnectionMock.new
+ @message = OpenStruct.new({:channel => "#test", :message => "!soup http://example.com/image.jpg", :nick => "LTe"})
- end
+ end
- it "should send image to soup" do
- Soup::Client.any_instance.stub(:login)
- Soup::Client.any_instance.stub(:new_image).with("http://example.com/image.jpg")
+ it "should send image to soup" do
+ Soup::Client.any_instance.stub(:login)
+ Soup::Client.any_instance.stub(:new_image).with("http://example.com/image.jpg")
- EM.run do
- @soup.call(@connection, @message)
- eventually(true) do
- @connection.messages.include?("soup updated :) | http://drugpl.soup.io/")
+ EM.run do
+ @soup.call(@connection, @message)
+ eventually(true) do
+ @connection.messages.include?("soup updated :) | http://drugpl.soup.io/")
+ end
end
end
end
end