cerberus 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Authors.txt +4 -0
- data/Changelog.txt +11 -0
- data/Copyright.txt +16 -0
- data/Rakefile +16 -25
- data/Readme.markdown +1 -3
- data/bin/cerberus +5 -0
- data/lib/cerberus/builder/bjam.rb +1 -3
- data/lib/cerberus/builder/maven2.rb +0 -1
- data/lib/cerberus/builder/rake.rb +1 -1
- data/lib/cerberus/builder/rspec.rb +0 -1
- data/lib/cerberus/builder/ruby_base.rb +0 -1
- data/lib/cerberus/component_lazy_loader.rb +6 -2
- data/lib/cerberus/config.example.yml +1 -0
- data/lib/cerberus/constants.rb +2 -2
- data/lib/cerberus/manager.rb +7 -1
- data/lib/cerberus/publisher/mail.rb +4 -4
- data/lib/cerberus/publisher/twitter.rb +0 -1
- data/lib/cerberus/scm/base.rb +19 -0
- data/lib/cerberus/scm/bzr.rb +62 -0
- data/lib/cerberus/scm/cvs.rb +2 -7
- data/lib/cerberus/scm/darcs.rb +2 -11
- data/lib/cerberus/scm/git.rb +6 -14
- data/lib/cerberus/scm/perforce.rb +4 -4
- data/lib/cerberus/scm/svn.rb +2 -7
- data/lib/cerberus/utils.rb +5 -0
- data/lib/vendor/irc/README +23 -0
- data/lib/vendor/irc/lib/IRC.rb +164 -0
- data/lib/vendor/irc/lib/IRCChannel.rb +33 -0
- data/lib/vendor/irc/lib/IRCConnection.rb +134 -0
- data/lib/vendor/irc/lib/IRCEvent.rb +91 -0
- data/lib/vendor/irc/lib/IRCUser.rb +23 -0
- data/lib/vendor/irc/lib/IRCUtil.rb +49 -0
- data/lib/vendor/irc/lib/eventmap.yml +247 -0
- data/lib/vendor/twitter/CHANGES +129 -0
- data/lib/vendor/twitter/MIT-LICENSE +20 -0
- data/lib/vendor/twitter/README +37 -0
- data/lib/vendor/twitter/TODO +7 -0
- data/lib/vendor/twitter/lib/twitter.rb +34 -0
- data/lib/vendor/twitter/lib/twitter/client.rb +24 -0
- data/lib/vendor/twitter/lib/twitter/client/account.rb +24 -0
- data/lib/vendor/twitter/lib/twitter/client/auth.rb +27 -0
- data/lib/vendor/twitter/lib/twitter/client/base.rb +93 -0
- data/lib/vendor/twitter/lib/twitter/client/blocks.rb +35 -0
- data/lib/vendor/twitter/lib/twitter/client/favorites.rb +53 -0
- data/lib/vendor/twitter/lib/twitter/client/friendship.rb +35 -0
- data/lib/vendor/twitter/lib/twitter/client/graph.rb +37 -0
- data/lib/vendor/twitter/lib/twitter/client/messaging.rb +79 -0
- data/lib/vendor/twitter/lib/twitter/client/profile.rb +29 -0
- data/lib/vendor/twitter/lib/twitter/client/search.rb +27 -0
- data/lib/vendor/twitter/lib/twitter/client/status.rb +51 -0
- data/lib/vendor/twitter/lib/twitter/client/timeline.rb +72 -0
- data/lib/vendor/twitter/lib/twitter/client/user.rb +65 -0
- data/lib/vendor/twitter/lib/twitter/config.rb +77 -0
- data/lib/vendor/twitter/lib/twitter/console.rb +31 -0
- data/lib/vendor/twitter/lib/twitter/core.rb +137 -0
- data/lib/vendor/twitter/lib/twitter/ext.rb +2 -0
- data/lib/vendor/twitter/lib/twitter/ext/stdlib.rb +52 -0
- data/lib/vendor/twitter/lib/twitter/extras.rb +39 -0
- data/lib/vendor/twitter/lib/twitter/meta.rb +56 -0
- data/lib/vendor/twitter/lib/twitter/model.rb +360 -0
- data/lib/vendor/twitter/lib/twitter/version.rb +19 -0
- data/lib/vendor/twitter/spec/twitter/client/account_spec.rb +28 -0
- data/lib/vendor/twitter/spec/twitter/client/auth_spec.rb +34 -0
- data/lib/vendor/twitter/spec/twitter/client/base_spec.rb +242 -0
- data/lib/vendor/twitter/spec/twitter/client/blocks_spec.rb +76 -0
- data/lib/vendor/twitter/spec/twitter/client/favorites_spec.rb +183 -0
- data/lib/vendor/twitter/spec/twitter/client/friendship_spec.rb +76 -0
- data/lib/vendor/twitter/spec/twitter/client/graph_spec.rb +67 -0
- data/lib/vendor/twitter/spec/twitter/client/messaging_spec.rb +135 -0
- data/lib/vendor/twitter/spec/twitter/client/profile_spec.rb +91 -0
- data/lib/vendor/twitter/spec/twitter/client/search_spec.rb +68 -0
- data/lib/vendor/twitter/spec/twitter/client/status_spec.rb +119 -0
- data/lib/vendor/twitter/spec/twitter/client/timeline_spec.rb +79 -0
- data/lib/vendor/twitter/spec/twitter/client/user_spec.rb +203 -0
- data/lib/vendor/twitter/spec/twitter/client_spec.rb +2 -0
- data/lib/vendor/twitter/spec/twitter/config_spec.rb +86 -0
- data/lib/vendor/twitter/spec/twitter/console_spec.rb +15 -0
- data/lib/vendor/twitter/spec/twitter/core_spec.rb +127 -0
- data/lib/vendor/twitter/spec/twitter/ext/stdlib_spec.rb +59 -0
- data/lib/vendor/twitter/spec/twitter/extras_spec.rb +46 -0
- data/lib/vendor/twitter/spec/twitter/meta_spec.rb +90 -0
- data/lib/vendor/twitter/spec/twitter/model_spec.rb +508 -0
- data/lib/vendor/twitter/spec/twitter/version_spec.rb +19 -0
- data/lib/vendor/xmpp4r/CHANGELOG +83 -0
- data/lib/vendor/xmpp4r/COPYING +340 -0
- data/lib/vendor/xmpp4r/LICENSE +59 -0
- data/lib/vendor/xmpp4r/README.rdoc +110 -0
- data/lib/vendor/xmpp4r/README_ruby19.txt +43 -0
- data/lib/vendor/xmpp4r/Rakefile +262 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/adventure/README +56 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/adventure/adventure.rb +23 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/adventure/adventuremuc.rb +136 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/adventure/cube.xml +15 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/adventure/tower.xml +69 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/adventure/world.rb +424 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/fileserve.conf +11 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/fileserve.rb +346 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/getonline.rb +56 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/gtkmucclient.rb +315 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/migrate.rb +88 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/minimuc.rb +266 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/pep-aggregator/index.xsl +235 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/pep-aggregator/pep-aggregator.rb +147 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/recvfile.rb +84 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/rosterdiscovery.rb +129 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/sendfile.conf +10 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/sendfile.rb +72 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr.rb +51 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_jabber.rb +43 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_test.rb +10 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/versionpoll.rb +90 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/xmpping.rb +146 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/advanced/xmppingrc.sample +14 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/change_password.rb +41 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/client.rb +70 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/component.rb +11 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/echo.rb +37 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/jabbersend.rb +41 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/mass_sender.rb +68 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/muc_owner_config.rb +12 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/mucinfo.rb +41 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/mucsimplebot.rb +82 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/register.rb +42 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/remove_registration.rb +18 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/roster.rb +44 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/rosterprint.rb +50 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/rosterrename.rb +34 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/rosterwatch.rb +171 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/send_vcard.rb +67 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/tune_client.rb +56 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/tune_server.rb +58 -0
- data/lib/vendor/xmpp4r/data/doc/xmpp4r/examples/basic/versionbot.rb +75 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r.rb +116 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/base64.rb +32 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams.rb +15 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/filetransfer.rb +319 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/base.rb +257 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/initiator.rb +31 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/ibb/target.rb +47 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb +152 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb +86 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb +198 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb +65 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb +73 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb.orig +62 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb +170 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/si.rb +206 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/callbacks.rb +124 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/caps.rb +1 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/caps/c.rb +53 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/caps/helper/generator.rb +160 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/caps/helper/helper.rb +87 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/client.rb +317 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/command/helper/responder.rb +53 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/command/iq/command.rb +154 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/component.rb +103 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/connection.rb +219 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/dataforms.rb +5 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/dataforms/x/data.rb +297 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/debuglog.rb +42 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/delay.rb +5 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/delay/x/delay.rb +99 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/discovery.rb +7 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/discovery/helper/responder.rb +165 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/discovery/iq/discoinfo.rb +211 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/discovery/iq/discoitems.rb +147 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/errors.rb +281 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/feature_negotiation.rb +5 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/feature_negotiation/iq/feature.rb +28 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/framework/base.rb +55 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/framework/bot.rb +148 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/httpbinding.rb +5 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/httpbinding/client.rb +285 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/idgenerator.rb +37 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/iq.rb +221 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/jid.rb +167 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/message.rb +148 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc.rb +14 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/helper/mucbrowser.rb +92 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/helper/mucclient.rb +462 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/helper/simplemucclient.rb +332 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/iq/mucadmin.rb +23 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/iq/mucadminitem.rb +20 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/iq/mucowner.rb +15 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/item.rb +143 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/x/muc.rb +70 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/x/mucuserinvite.rb +60 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/muc/x/mucuseritem.rb +36 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/presence.rb +232 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub.rb +8 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/configuration.rb +86 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/event.rb +49 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/item.rb +35 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/items.rb +44 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/node_config.rb +48 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/publish.rb +24 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/subscription.rb +62 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/subscription_config.rb +67 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/children/unsubscribe.rb +48 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/helper/nodebrowser.rb +130 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/helper/nodehelper.rb +156 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/helper/servicehelper.rb +417 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/pubsub/iq/pubsub.rb +19 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/query.rb +15 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/rexmladdons.rb +151 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/roster.rb +7 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/roster/helper/roster.rb +519 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/roster/iq/roster.rb +215 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/roster/x/roster.rb +138 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/rpc.rb +2 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/rpc/helper/client.rb +123 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/rpc/helper/server.rb +74 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/rpc/helper/xmlrpcaddons.rb +67 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/rpc/iq/rpc.rb +23 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/sasl.rb +237 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/semaphore.rb +38 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/stream.rb +497 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/streamparser.rb +77 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/tune.rb +2 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/tune/helper/helper.rb +58 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/tune/tune.rb +113 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/vcard.rb +6 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/vcard/helper/vcard.rb +84 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/vcard/iq/vcard.rb +109 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/version.rb +7 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/version/helper/responder.rb +72 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/version/helper/simpleresponder.rb +44 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/version/iq/version.rb +105 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/x.rb +37 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/xhtml.rb +1 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/xhtml/html.rb +115 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/xmpp4r.rb +18 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/xmppelement.rb +168 -0
- data/lib/vendor/xmpp4r/lib/xmpp4r/xmppstanza.rb +162 -0
- data/lib/vendor/xmpp4r/setup.rb +1586 -0
- data/lib/vendor/xmpp4r/test/bytestreams/tc_ibb.rb +186 -0
- data/lib/vendor/xmpp4r/test/bytestreams/tc_socks5bytestreams.rb +113 -0
- data/lib/vendor/xmpp4r/test/caps/tc_helper.rb +156 -0
- data/lib/vendor/xmpp4r/test/dataforms/tc_data.rb +81 -0
- data/lib/vendor/xmpp4r/test/delay/tc_xdelay.rb +51 -0
- data/lib/vendor/xmpp4r/test/discovery/tc_responder.rb +91 -0
- data/lib/vendor/xmpp4r/test/lib/assert_equal_xml.rb +14 -0
- data/lib/vendor/xmpp4r/test/lib/clienttester.rb +120 -0
- data/lib/vendor/xmpp4r/test/muc/tc_muc_mucclient.rb +830 -0
- data/lib/vendor/xmpp4r/test/muc/tc_muc_simplemucclient.rb +114 -0
- data/lib/vendor/xmpp4r/test/muc/tc_mucowner.rb +50 -0
- data/lib/vendor/xmpp4r/test/pubsub/tc_helper.rb +662 -0
- data/lib/vendor/xmpp4r/test/pubsub/tc_nodeconfig.rb +54 -0
- data/lib/vendor/xmpp4r/test/pubsub/tc_subscriptionconfig.rb +41 -0
- data/lib/vendor/xmpp4r/test/roster/tc_helper.rb +514 -0
- data/lib/vendor/xmpp4r/test/roster/tc_iqqueryroster.rb +173 -0
- data/lib/vendor/xmpp4r/test/roster/tc_xroster.rb +73 -0
- data/lib/vendor/xmpp4r/test/rpc/tc_helper.rb +96 -0
- data/lib/vendor/xmpp4r/test/tc_callbacks.rb +129 -0
- data/lib/vendor/xmpp4r/test/tc_class_names.rb +146 -0
- data/lib/vendor/xmpp4r/test/tc_client.rb +30 -0
- data/lib/vendor/xmpp4r/test/tc_errors.rb +146 -0
- data/lib/vendor/xmpp4r/test/tc_idgenerator.rb +30 -0
- data/lib/vendor/xmpp4r/test/tc_iq.rb +113 -0
- data/lib/vendor/xmpp4r/test/tc_iqquery.rb +31 -0
- data/lib/vendor/xmpp4r/test/tc_jid.rb +204 -0
- data/lib/vendor/xmpp4r/test/tc_message.rb +116 -0
- data/lib/vendor/xmpp4r/test/tc_presence.rb +150 -0
- data/lib/vendor/xmpp4r/test/tc_rexml.rb +139 -0
- data/lib/vendor/xmpp4r/test/tc_stream.rb +229 -0
- data/lib/vendor/xmpp4r/test/tc_streamComponent.rb +95 -0
- data/lib/vendor/xmpp4r/test/tc_streamError.rb +131 -0
- data/lib/vendor/xmpp4r/test/tc_streamSend.rb +59 -0
- data/lib/vendor/xmpp4r/test/tc_streamparser.rb +112 -0
- data/lib/vendor/xmpp4r/test/tc_xmppstanza.rb +135 -0
- data/lib/vendor/xmpp4r/test/ts_xmpp4r.rb +53 -0
- data/lib/vendor/xmpp4r/test/tune/tc_helper_recv.rb +84 -0
- data/lib/vendor/xmpp4r/test/tune/tc_helper_send.rb +74 -0
- data/lib/vendor/xmpp4r/test/tune/tc_tune.rb +79 -0
- data/lib/vendor/xmpp4r/test/vcard/tc_helper.rb +49 -0
- data/lib/vendor/xmpp4r/test/vcard/tc_iqvcard.rb +62 -0
- data/lib/vendor/xmpp4r/test/version/tc_helper.rb +60 -0
- data/lib/vendor/xmpp4r/test/version/tc_iqqueryversion.rb +97 -0
- data/lib/vendor/xmpp4r/test/xhtml/tc_html.rb +41 -0
- data/lib/vendor/xmpp4r/tools/gen_requires.bash +31 -0
- data/lib/vendor/xmpp4r/tools/xmpp4r-gemspec-test.rb +11 -0
- data/lib/vendor/xmpp4r/xmpp4r.gemspec +291 -0
- data/test/jabber_publisher_test.rb +1 -1
- data/test/mail_publisher_test.rb +2 -2
- data/test/mock/twitter.rb +0 -1
- data/test/rspec_builder_test.rb +39 -2
- data/test/rss_publisher_test.rb +1 -1
- data/test/twitter_publisher_test.rb +1 -1
- metadata +268 -53
- data/lib/cerberus/publisher/gmailer.rb +0 -17
@@ -0,0 +1,76 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#friend" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@id = 1234567
|
7
|
+
@screen_name = 'dummylogin'
|
8
|
+
@friend = Twitter::User.new(:id => @id, :screen_name => @screen_name)
|
9
|
+
@uris = Twitter::Client.class_eval("@@FRIENDSHIP_URIS")
|
10
|
+
@request = mas_net_http_post(:basic_auth => nil)
|
11
|
+
@response = mas_net_http_response(:success)
|
12
|
+
@connection = mas_net_http(@response)
|
13
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
14
|
+
Twitter::User.stub!(:unmarshal).and_return(@friend)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_uri(action, id)
|
18
|
+
"#{@uris[action]}/#{id}.json"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should create expected HTTP GET request for :add case using integer user ID" do
|
22
|
+
# the integer user ID scenario...
|
23
|
+
@twitter.should_receive(:create_http_post_request).with(create_uri(:add, @id)).and_return(@request)
|
24
|
+
@twitter.friend(:add, @id)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should create expected HTTP GET request for :add case using screen name" do
|
28
|
+
# the screen name scenario...
|
29
|
+
@twitter.should_receive(:create_http_post_request).with(create_uri(:add, @screen_name)).and_return(@request)
|
30
|
+
@twitter.friend(:add, @screen_name)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should create expected HTTP GET request for :add case using Twitter::User object" do
|
34
|
+
# the Twitter::User object scenario...
|
35
|
+
@twitter.should_receive(:create_http_post_request).with(create_uri(:add, @friend.to_i)).and_return(@request)
|
36
|
+
@twitter.friend(:add, @friend)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should create expected HTTP GET request for :remove case using integer user ID" do
|
40
|
+
# the integer user ID scenario...
|
41
|
+
@twitter.should_receive(:create_http_post_request).with(create_uri(:remove, @id)).and_return(@request)
|
42
|
+
@twitter.friend(:remove, @id)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should create expected HTTP GET request for :remove case using screen name" do
|
46
|
+
# the screen name scenario...
|
47
|
+
@twitter.should_receive(:create_http_post_request).with(create_uri(:remove, @screen_name)).and_return(@request)
|
48
|
+
@twitter.friend(:remove, @screen_name)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should create expected HTTP GET request for :remove case using Twitter::User object" do
|
52
|
+
# the Twitter::User object scenario...
|
53
|
+
@twitter.should_receive(:create_http_post_request).with(create_uri(:remove, @friend.to_i)).and_return(@request)
|
54
|
+
@twitter.friend(:remove, @friend)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should bless user model returned for :add case" do
|
58
|
+
@twitter.should_receive(:bless_model).with(@friend)
|
59
|
+
@twitter.friend(:add, @friend)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should bless user model returned for :remove case" do
|
63
|
+
@twitter.should_receive(:bless_model).with(@friend)
|
64
|
+
@twitter.friend(:remove, @friend)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should raise ArgumentError if action given is not valid" do
|
68
|
+
lambda {
|
69
|
+
@twitter.friend(:crap, @friend)
|
70
|
+
}.should raise_error(ArgumentError)
|
71
|
+
end
|
72
|
+
|
73
|
+
after(:each) do
|
74
|
+
nilize(@twitter, @id, @uris, @request, @response, @connection)
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#graph(:friends...)" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@id = 1234567
|
7
|
+
@screen_name = 'dummylogin'
|
8
|
+
@friend = Twitter::User.new(:id => @id, :screen_name => @screen_name)
|
9
|
+
@uris = Twitter::Client.class_eval("@@GRAPH_URIS")
|
10
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
11
|
+
@response = mas_net_http_response(:success)
|
12
|
+
@response.stub!(:body).and_return("[1, 2, 3, 4, 5, 6]")
|
13
|
+
@connection = mas_net_http(@response)
|
14
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
15
|
+
Twitter::User.stub!(:unmarshal).and_return(@friend)
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_uri(action)
|
19
|
+
"#{@uris[action]}.json"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should create expected HTTP GET request for :friends case using integer user ID" do
|
23
|
+
# the integer user ID scenario...
|
24
|
+
@twitter.should_receive(:create_http_get_request).with(create_uri(:friends), :id => @id).and_return(@request)
|
25
|
+
@twitter.graph(:friends, @id)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should create expected HTTP GET request for :friends case using screen name" do
|
29
|
+
# the screen name scenario...
|
30
|
+
@twitter.should_receive(:create_http_get_request).with(create_uri(:friends), :id => @screen_name).and_return(@request)
|
31
|
+
@twitter.graph(:friends, @screen_name)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should create expected HTTP GET request for :friends case using Twitter::User object" do
|
35
|
+
# the Twitter::User object scenario...
|
36
|
+
@twitter.should_receive(:create_http_get_request).with(create_uri(:friends), :id => @friend.to_i).and_return(@request)
|
37
|
+
@twitter.graph(:friends, @friend)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should create expected HTTP GET request for :followers case using integer user ID" do
|
41
|
+
# the integer user ID scenario...
|
42
|
+
@twitter.should_receive(:create_http_get_request).with(create_uri(:followers), :id => @id).and_return(@request)
|
43
|
+
@twitter.graph(:followers, @id)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should create expected HTTP GET request for :followers case using screen name" do
|
47
|
+
# the screen name scenario...
|
48
|
+
@twitter.should_receive(:create_http_get_request).with(create_uri(:followers), :id => @screen_name).and_return(@request)
|
49
|
+
@twitter.graph(:followers, @screen_name)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should create expected HTTP GET request for :followers case using Twitter::User object" do
|
53
|
+
# the Twitter::User object scenario...
|
54
|
+
@twitter.should_receive(:create_http_get_request).with(create_uri(:followers), :id => @friend.to_i).and_return(@request)
|
55
|
+
@twitter.graph(:followers, @friend)
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should raise ArgumentError if action given is not valid" do
|
59
|
+
lambda {
|
60
|
+
@twitter.graph(:crap, @friend)
|
61
|
+
}.should raise_error(ArgumentError)
|
62
|
+
end
|
63
|
+
|
64
|
+
after(:each) do
|
65
|
+
nilize(@twitter, @id, @uris, @request, @response, @connection)
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#messages" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@uris = Twitter::Client.class_eval("@@MESSAGING_URIS")
|
7
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
8
|
+
@response = mas_net_http_response(:success, "[]")
|
9
|
+
@connection = mas_net_http(@response)
|
10
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
11
|
+
@messages = []
|
12
|
+
Twitter::Message.stub!(:unmarshal).and_return(@messages)
|
13
|
+
@page = 2
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should create expected HTTP GET request for :received case" do
|
17
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:received], {}).and_return(@request)
|
18
|
+
@twitter.messages(:received)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should bless the Array returned from Twitter for :received case" do
|
22
|
+
@twitter.should_receive(:bless_models).with(@messages).and_return(@messages)
|
23
|
+
@twitter.messages(:received)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should create expected HTTP GET request for :sent case" do
|
27
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:sent], {}).and_return(@request)
|
28
|
+
@twitter.messages(:sent)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should bless the Array returned from Twitter for :sent case" do
|
32
|
+
@twitter.should_receive(:bless_models).with(@messages).and_return(@messages)
|
33
|
+
@twitter.messages(:sent)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should raise an ArgumentError when giving an invalid messaging action" do
|
37
|
+
lambda {
|
38
|
+
@twitter.messages(:crap)
|
39
|
+
}.should raise_error(ArgumentError)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should accept an options Hash for paging" do
|
43
|
+
lambda {
|
44
|
+
@twitter.messages(:sent, :page => @page)
|
45
|
+
}.should_not raise_error(Exception)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should generate expected GET HTTP request for paging case" do
|
49
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:received], {:page => @page}).and_return(@request)
|
50
|
+
@twitter.messages(:received, :page => @page)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should bless models for paging case" do
|
54
|
+
@twitter.should_receive(:bless_models).with(@messages).and_return(@messages)
|
55
|
+
@twitter.messages(:sent, :page => @page)
|
56
|
+
end
|
57
|
+
|
58
|
+
after(:each) do
|
59
|
+
nilize(@twitter, @uris, @request, @response, @connection, @messages)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe Twitter::Client, "#message" do
|
64
|
+
before(:each) do
|
65
|
+
@twitter = client_context
|
66
|
+
@attributes = {
|
67
|
+
:id => 34324,
|
68
|
+
:text => 'Randy, are you coming over later?',
|
69
|
+
:sender => {:id => 123, :screen_name => 'mylogin'},
|
70
|
+
:recipient => {:id => 1234, :screen_name => 'randy'},
|
71
|
+
}
|
72
|
+
@message = Twitter::Message.new(@attributes)
|
73
|
+
@uris = Twitter::Client.class_eval("@@MESSAGING_URIS")
|
74
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
75
|
+
@json = JSON.unparse(@attributes)
|
76
|
+
@response = mas_net_http_response(:success, @json)
|
77
|
+
@connection = mas_net_http(@response)
|
78
|
+
@source = Twitter::Client.class_eval("@@defaults[:source]")
|
79
|
+
|
80
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
81
|
+
Twitter::Message.stub!(:unmarshal).and_return(@message)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should invoke #http_connect with expected arguments for :post case" do
|
85
|
+
@twitter.should_receive(:http_connect).with({:text => @message.text, :user => @message.recipient.to_i, :source => @source}.to_http_str).and_return(@response)
|
86
|
+
@twitter.message(:post, @message.text, @message.recipient)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should create expected HTTP POST request for :post case" do
|
90
|
+
@twitter.should_receive(:create_http_post_request).with(@uris[:post]).and_return(@request)
|
91
|
+
@twitter.message(:post, @message.text, @message.recipient)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should bless returned Twitter::Message object for :post case" do
|
95
|
+
@twitter.should_receive(:bless_model).with(@message)
|
96
|
+
@twitter.message(:post, @message.text, @message.recipient)
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should create expected HTTP DELETE request for :delete case" do
|
100
|
+
@twitter.should_receive(:create_http_delete_request).with(@uris[:delete], {:id => @message.to_i}).and_return(@request)
|
101
|
+
@twitter.message(:delete, @message)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should bless returned Twitter::Message object for :delete case" do
|
105
|
+
@twitter.should_receive(:bless_model).with(@message)
|
106
|
+
@twitter.message(:delete, @message)
|
107
|
+
end
|
108
|
+
|
109
|
+
it "should invoke #to_i on message object passed in for :delete case" do
|
110
|
+
@message.should_receive(:to_i).and_return(@message.id)
|
111
|
+
@twitter.message(:delete, @message)
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should raise an ArgumentError when giving an invalid messaging action" do
|
115
|
+
lambda {
|
116
|
+
@twitter.message(:crap, @message)
|
117
|
+
}.should raise_error(ArgumentError)
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should raise an ArgumentError for :post case if user argument is not supplied" do
|
121
|
+
lambda {
|
122
|
+
@twitter.message(:post, @message)
|
123
|
+
}.should raise_error(ArgumentError)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should raise an ArgumentError for :post case if user argument is nil" do
|
127
|
+
lambda {
|
128
|
+
@twitter.message(:post, @message, nil)
|
129
|
+
}.should raise_error(ArgumentError)
|
130
|
+
end
|
131
|
+
|
132
|
+
after(:each) do
|
133
|
+
nilize(@twitter, @uris, @request, @response, @connection, @sender, @recipient, @message, @attributes)
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#profile" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@user_attrs = {
|
7
|
+
:id => "JaneEyre",
|
8
|
+
:login => "Jane Eyre",
|
9
|
+
:url => "http://janeeyrerocks.co.uk",
|
10
|
+
:location => "Thornfield Manor",
|
11
|
+
}
|
12
|
+
# name, email, url, location, description
|
13
|
+
@info_attrs = {
|
14
|
+
:name => "Jane Eyre",
|
15
|
+
:email => "jane.eyre@gmail.co.uk",
|
16
|
+
:url => "http://janeeyrerocks.co.uk",
|
17
|
+
:location => "Thornfield Manor",
|
18
|
+
:description => "Governess who falls for slave-trade aristocrat with French lovechild he doesn't acknowledge & wife locked in damp attic with keeper.",
|
19
|
+
}
|
20
|
+
# background_color, text_color, link_color, sidebar_fill_color, sidebar_border_color
|
21
|
+
@colors_attrs = {
|
22
|
+
:background_color => "#ffffff",
|
23
|
+
:text_color => "#101010",
|
24
|
+
:link_color => "#990000",
|
25
|
+
}
|
26
|
+
# value
|
27
|
+
@device_attrs = {
|
28
|
+
:value => "sms",
|
29
|
+
}
|
30
|
+
@user = Twitter::User.new
|
31
|
+
@uris = Twitter::Client.class_eval("@@PROFILE_URIS")
|
32
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
33
|
+
@json = JSON.unparse(@user_attrs)
|
34
|
+
@response = mas_net_http_response(:success, @json)
|
35
|
+
@connection = mas_net_http(@response)
|
36
|
+
|
37
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
38
|
+
Twitter::User.stub!(:unmarshal).and_return(@user)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should invoke #http_connect with expected arguments for :info case" do
|
42
|
+
@twitter.should_receive(:http_connect).with(@info_attrs.to_http_str).and_return(@response)
|
43
|
+
@twitter.profile(:info, @info_attrs)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should invoke #http_connect with expected arguments for :colors case" do
|
47
|
+
@twitter.should_receive(:http_connect).with(@colors_attrs.to_http_str).and_return(@response)
|
48
|
+
@twitter.profile(:colors, @colors_attrs)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should invoke #http_connect with expected arguments for :device case" do
|
52
|
+
@twitter.should_receive(:http_connect).with(@device_attrs.to_http_str).and_return(@response)
|
53
|
+
@twitter.profile(:info, @device_attrs)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should create expected HTTP POST request for :info case" do
|
57
|
+
@twitter.should_receive(:create_http_post_request).with(@uris[:info]).and_return(@request)
|
58
|
+
@twitter.profile(:info, @info_attrs)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should create expected HTTP POST request for :colors case" do
|
62
|
+
@twitter.should_receive(:create_http_post_request).with(@uris[:colors]).and_return(@request)
|
63
|
+
@twitter.profile(:colors, @colors_attrs)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should create expected HTTP POST request for :device case" do
|
67
|
+
@twitter.should_receive(:create_http_post_request).with(@uris[:device]).and_return(@request)
|
68
|
+
@twitter.profile(:device, @device_attrs)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should bless returned Twitter::User object for :info case" do
|
72
|
+
@twitter.should_receive(:bless_model).with(@user)
|
73
|
+
@twitter.profile(:info, @info_attrs)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should bless returned Twitter::User object for :colors case" do
|
77
|
+
@twitter.should_receive(:bless_model).with(@user)
|
78
|
+
@twitter.profile(:colors, @colors_attrs)
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should bless returned Twitter::User object for :device case" do
|
82
|
+
@twitter.should_receive(:bless_model).with(@user)
|
83
|
+
@twitter.profile(:device, @device_attrs)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should raise an ArgumentError when giving an invalid profile action"
|
87
|
+
|
88
|
+
after(:each) do
|
89
|
+
nilize(@twitter, @uris, @request, @response, @connection, @sender, @recipient, @user, @attributes)
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#search" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@uris = Twitter::Client.class_eval("@@SEARCH_URIS")
|
7
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
8
|
+
@response = mas_net_http_response(:success, "{\"results\": [], \"refresh_url\":\"?since_id=1768746401&q=blabla\"}")
|
9
|
+
@connection = mas_net_http(@response)
|
10
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
11
|
+
@statuses = []
|
12
|
+
Twitter::Status.stub!(:unmarshal).and_return(@statuses)
|
13
|
+
@page = 2
|
14
|
+
@keywords = "twitter4r"
|
15
|
+
@to = "SusanPotter"
|
16
|
+
@from = "twitter4r"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should create expected HTTP GET request using :to" do
|
20
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:basic], {:to => @to}).and_return(@request)
|
21
|
+
@twitter.search(:to => @to)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should bless the Array returned from Twitter for :to case" do
|
25
|
+
@twitter.should_receive(:bless_models).with(@statuses).and_return(@statuses)
|
26
|
+
@twitter.search(:to => @to)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should create expected HTTP GET request using :from" do
|
30
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:basic], {:from => @from}).and_return(@request)
|
31
|
+
@twitter.search(:from => @from)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should bless the Array returned from Twitter for :to case" do
|
35
|
+
@twitter.should_receive(:bless_models).with(@statuses).and_return(@statuses)
|
36
|
+
@twitter.search(:from => @from)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should create expected HTTP GET request using :keywords" do
|
40
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:basic], {:keywords => @keywords}).and_return(@request)
|
41
|
+
@twitter.search(:keywords => @keywords)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should bless the Array returned from Twitter for :keywords case" do
|
45
|
+
@twitter.should_receive(:bless_models).with(@statuses).and_return(@statuses)
|
46
|
+
@twitter.search(:keywords => @keywords)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should accept paging option" do
|
50
|
+
lambda {
|
51
|
+
@twitter.search(:keywords => @keywords, :page => @page)
|
52
|
+
}.should_not raise_error(Exception)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should generate expected GET HTTP request for paging case" do
|
56
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:basic], {:page => @page}).and_return(@request)
|
57
|
+
@twitter.search(:page => @page)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should bless models for paging case" do
|
61
|
+
@twitter.should_receive(:bless_models).with(@statuses).and_return(@statuses)
|
62
|
+
@twitter.search(:page => @page)
|
63
|
+
end
|
64
|
+
|
65
|
+
after(:each) do
|
66
|
+
nilize(@twitter, @uris, @request, @response, @connection, @statuses)
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#status" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@message = 'This is my unique message'
|
7
|
+
@uris = Twitter::Client.class_eval("@@STATUS_URIS")
|
8
|
+
@options = {:id => 666666}
|
9
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
10
|
+
@response = mas_net_http_response(:success, '{}')
|
11
|
+
@connection = mas_net_http(@response)
|
12
|
+
@float = 43.3434
|
13
|
+
@status = Twitter::Status.new(:id => 2349343)
|
14
|
+
@reply_to_status_id = 3495293
|
15
|
+
@source = Twitter::Client.class_eval("@@defaults[:source]")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should return nil if nil is passed as value argument for :get case" do
|
19
|
+
status = @twitter.status(:get, nil)
|
20
|
+
status.should be_nil
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should not call @twitter#http_connect when passing nil for value argument in :get case" do
|
24
|
+
@twitter.should_not_receive(:http_connect)
|
25
|
+
@twitter.status(:get, nil)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should create expected HTTP GET request for :get case" do
|
29
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:get], @options).and_return(@request)
|
30
|
+
@twitter.status(:get, @options[:id])
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should invoke @twitter#create_http_get_request with given parameters equivalent to {:id => value.to_i} for :get case" do
|
34
|
+
# Float case
|
35
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:get], {:id => @float.to_i}).and_return(@request)
|
36
|
+
@twitter.status(:get, @float)
|
37
|
+
|
38
|
+
# Twitter::Status object case
|
39
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:get], {:id => @status.to_i}).and_return(@request)
|
40
|
+
@twitter.status(:get, @status)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should return nil if nil is passed as value argument for :post case" do
|
44
|
+
status = @twitter.status(:post, nil)
|
45
|
+
status.should be_nil
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should not call @twitter#http_connect when passing nil for value argument in :post case" do
|
49
|
+
@twitter.should_not_receive(:http_connect)
|
50
|
+
@twitter.status(:post, nil)
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should create expected HTTP POST request for :post case" do
|
54
|
+
@twitter.should_receive(:create_http_post_request).with(@uris[:post]).and_return(@request)
|
55
|
+
@connection.should_receive(:request).with(@request, {:status => @message, :source => @source}.to_http_str).and_return(@response)
|
56
|
+
@twitter.status(:post, @message)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should return nil if no :status key-value given in the value argument for :reply case" do
|
60
|
+
status = @twitter.status(:reply, {})
|
61
|
+
status.should be_nil
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should return nil if nil is passed as value argument for :reply case" do
|
65
|
+
status = @twitter.status(:reply, nil)
|
66
|
+
status.should be_nil
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should not call @twitter#http_connect when passing a value Hash argument that has no :status key-value in :reply case" do
|
70
|
+
@twitter.should_not_receive(:http_connect)
|
71
|
+
@twitter.status(:reply, {})
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should not call @twitter#http_connect when passing nil for value argument in :reply case" do
|
75
|
+
@twitter.should_not_receive(:http_connect)
|
76
|
+
@twitter.status(:reply, nil)
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should create expected HTTP POST request for :reply case" do
|
80
|
+
@twitter.should_receive(:create_http_post_request).with(@uris[:reply]).and_return(@request)
|
81
|
+
@connection.should_receive(:request).with(@request, {:status => @message, :source => @source, :in_reply_to_status_id => @reply_to_status_id}.to_http_str).and_return(@response)
|
82
|
+
@twitter.status(:reply, :status => @message, :in_reply_to_status_id => @reply_to_status_id)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should return nil if nil is passed as value argument for :delete case" do
|
86
|
+
status = @twitter.status(:delete, nil)
|
87
|
+
status.should be_nil
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should not call @twitter#http_connect when passing nil for value argument in :delete case" do
|
91
|
+
@twitter.should_not_receive(:http_connect)
|
92
|
+
@twitter.status(:delete, nil)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should create expected HTTP DELETE request for :delete case" do
|
96
|
+
@twitter.should_receive(:create_http_delete_request).with(@uris[:delete], @options).and_return(@request)
|
97
|
+
@twitter.status(:delete, @options[:id])
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should invoke @twitter#create_http_get_request with given parameters equivalent to {:id => value.to_i} for :delete case" do
|
101
|
+
# Float case
|
102
|
+
@twitter.should_receive(:create_http_delete_request).with(@uris[:delete], {:id => @float.to_i}).and_return(@request)
|
103
|
+
@twitter.status(:delete, @float)
|
104
|
+
|
105
|
+
# Twitter::Status object case
|
106
|
+
@twitter.should_receive(:create_http_delete_request).with(@uris[:delete], {:id => @status.to_i}).and_return(@request)
|
107
|
+
@twitter.status(:delete, @status)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should raise an ArgumentError when given an invalid status action" do
|
111
|
+
lambda {
|
112
|
+
@twitter.status(:crap, nil)
|
113
|
+
}.should raise_error(ArgumentError)
|
114
|
+
end
|
115
|
+
|
116
|
+
after(:each) do
|
117
|
+
nilize(@twitter)
|
118
|
+
end
|
119
|
+
end
|