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,79 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "Timeline API" do
|
4
|
+
before(:each) do
|
5
|
+
@client = client_context
|
6
|
+
@uris = Twitter::Client.class_eval("@@TIMELINE_URIS")
|
7
|
+
@user = Twitter::User.new(:screen_name => 'mylogin')
|
8
|
+
@status = Twitter::Status.new(:id => 23343443, :text => 'I love Lucy!', :user => @user)
|
9
|
+
@timeline = [@status]
|
10
|
+
@json = JSON.unparse([@status.to_hash])
|
11
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
12
|
+
@response = mas_net_http_response(:success, @json)
|
13
|
+
@connection = mas_net_http(@response)
|
14
|
+
@params = {
|
15
|
+
:public => {:since_id => 3249328},
|
16
|
+
:friends => {:id => 'myfriend'},
|
17
|
+
:user => {:id => 'auser'},
|
18
|
+
:me => {},
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should respond to instance method #timeline_for" do
|
23
|
+
@client.should respond_to(:timeline_for)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should call #http_get with expected parameters for :public case" do
|
27
|
+
@client.should_receive(:http_connect).and_return(mas_net_http_response(:success, @json))
|
28
|
+
@client.timeline_for(:public)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should yield to block for each status in timeline" do
|
32
|
+
@client.should_receive(:http_connect).and_return(mas_net_http_response(:success, @json))
|
33
|
+
Twitter::Status.should_receive(:unmarshal).and_return(@timeline)
|
34
|
+
count = 0
|
35
|
+
@client.timeline_for(:public) do |status|
|
36
|
+
status.should eql(@status)
|
37
|
+
count += 1
|
38
|
+
end
|
39
|
+
count.should eql(@timeline.size)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should generate expected HTTP GET request for generic :public case" do
|
43
|
+
@client.should_receive(:create_http_get_request).with(@uris[:public], {}).and_return(@request)
|
44
|
+
timeline = @client.timeline_for(:public)
|
45
|
+
timeline.should eql(@timeline)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should generate expected HTTP GET request for :public case with expected parameters" do
|
49
|
+
@client.should_receive(:create_http_get_request).with(@uris[:public], @params[:public]).and_return(@request)
|
50
|
+
timeline = @client.timeline_for(:public, @params[:public])
|
51
|
+
timeline.should eql(@timeline)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should generate expected HTTP GET request for generic :friends case" do
|
55
|
+
@client.should_receive(:create_http_get_request).with(@uris[:friends], {}).and_return(@request)
|
56
|
+
timeline = @client.timeline_for(:friends)
|
57
|
+
timeline.should eql(@timeline)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should generate expected HTTP GET request for :friends case with expected parameters" do
|
61
|
+
@client.should_receive(:create_http_get_request).with(@uris[:friends], @params[:friends]).and_return(@request)
|
62
|
+
timeline = @client.timeline_for(:friends, @params[:friends])
|
63
|
+
timeline.should eql(@timeline)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should raise an ArgumentError if type given is not valid" do
|
67
|
+
lambda {
|
68
|
+
@client.timeline_for(:crap)
|
69
|
+
}.should raise_error(ArgumentError)
|
70
|
+
|
71
|
+
lambda {
|
72
|
+
@client.timeline_for(:crap, @params[:friends])
|
73
|
+
}.should raise_error(ArgumentError)
|
74
|
+
end
|
75
|
+
|
76
|
+
after(:each) do
|
77
|
+
nilize(@client)
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,203 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, "#user(id, :info)" do
|
4
|
+
before(:each) do
|
5
|
+
@twitter = client_context
|
6
|
+
@id = 395783
|
7
|
+
@screen_name = 'boris_johnson_is_funny_as_hell'
|
8
|
+
@user = Twitter::User.new(
|
9
|
+
:id => @id,
|
10
|
+
:screen_name => @screen_name,
|
11
|
+
:location => 'London'
|
12
|
+
)
|
13
|
+
@json = JSON.unparse(@user.to_hash)
|
14
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
15
|
+
@response = mas_net_http_response(:success, @json)
|
16
|
+
@connection = mas_net_http(@response)
|
17
|
+
@uris = Twitter::Client.class_eval("@@USER_URIS")
|
18
|
+
@twitter.stub!(:create_http_get_request).and_return(@request)
|
19
|
+
Twitter::User.stub!(:unmarshal).and_return(@user)
|
20
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should create expected HTTP GET request when giving numeric user id" do
|
24
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:info], {:id => @id}).and_return(@request)
|
25
|
+
@twitter.user(@id)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should create expected HTTP GET request when giving screen name" do
|
29
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:info], {:id => @screen_name}).and_return(@request)
|
30
|
+
@twitter.user(@screen_name)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should bless model returned when giving numeric user id" do
|
34
|
+
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
|
35
|
+
@twitter.user(@id)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should bless model returned when giving screen name" do
|
39
|
+
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
|
40
|
+
@twitter.user(@screen_name)
|
41
|
+
end
|
42
|
+
|
43
|
+
after(:each) do
|
44
|
+
nilize(@request, @response, @connection, @twitter, @id, @screen_name, @user)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# TODO: Add specs for new Twitter::Client#user(id, :friends) and
|
49
|
+
# Twitter::Client#user(id, :followers) use cases.
|
50
|
+
describe Twitter::Client, "#user(id, :friends)" do
|
51
|
+
before(:each) do
|
52
|
+
@twitter = client_context
|
53
|
+
@id = 395784
|
54
|
+
@screen_name = 'cafe_paradiso'
|
55
|
+
@user = Twitter::User.new(
|
56
|
+
:id => @id,
|
57
|
+
:screen_name => @screen_name,
|
58
|
+
:location => 'Urbana, IL'
|
59
|
+
)
|
60
|
+
@json = JSON.unparse(@user.to_hash)
|
61
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
62
|
+
@response = mas_net_http_response(:success, @json)
|
63
|
+
@connection = mas_net_http(@response)
|
64
|
+
@uris = Twitter::Client.class_eval("@@USER_URIS")
|
65
|
+
@twitter.stub!(:create_http_get_request).and_return(@request)
|
66
|
+
Twitter::User.stub!(:unmarshal).and_return(@user)
|
67
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should create expected HTTP GET request when giving numeric user id" do
|
71
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:friends], {:id => @id}).and_return(@request)
|
72
|
+
@twitter.user(@id, :friends)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should invoke #to_i on Twitter::User objecct given" do
|
76
|
+
@user.should_receive(:to_i).and_return(@id)
|
77
|
+
@twitter.user(@user, :friends)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should create expected HTTP GET request when giving Twitter::User object" do
|
81
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:friends], {:id => @user.to_i}).and_return(@request)
|
82
|
+
@twitter.user(@user, :friends)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should create expected HTTP GET request when giving screen name" do
|
86
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:friends], {:id => @screen_name}).and_return(@request)
|
87
|
+
@twitter.user(@screen_name, :friends)
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should bless model returned when giving numeric id" do
|
91
|
+
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
|
92
|
+
@twitter.user(@id, :friends)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should bless model returned when giving Twitter::User object" do
|
96
|
+
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
|
97
|
+
@twitter.user(@user, :friends)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should bless model returned when giving screen name" do
|
101
|
+
@twitter.should_receive(:bless_model).with(@user).and_return(@user)
|
102
|
+
@twitter.user(@screen_name, :friends)
|
103
|
+
end
|
104
|
+
|
105
|
+
after(:each) do
|
106
|
+
nilize(@request, @response, @connection, @twitter, @id, @screen_name, @user)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe Twitter::Client, "#my(:info)" do
|
111
|
+
before(:each) do
|
112
|
+
@twitter = client_context
|
113
|
+
@screen_name = @twitter.instance_eval("@login")
|
114
|
+
@user = Twitter::User.new(
|
115
|
+
:id => 2394393,
|
116
|
+
:screen_name => @screen_name,
|
117
|
+
:location => 'Glamorous Urbana'
|
118
|
+
)
|
119
|
+
@json = JSON.unparse(@user.to_hash)
|
120
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
121
|
+
@response = mas_net_http_response(:success, @json)
|
122
|
+
@connection = mas_net_http(@response)
|
123
|
+
@uris = Twitter::Client.class_eval("@@USER_URIS")
|
124
|
+
@twitter.stub!(:create_http_get_request).and_return(@request)
|
125
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
126
|
+
Twitter::User.stub!(:unmarshal).and_return(@user)
|
127
|
+
end
|
128
|
+
|
129
|
+
it "should create expected HTTP GET request" do
|
130
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:info], :id => @screen_name).and_return(@request)
|
131
|
+
@twitter.my(:info)
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should bless the model object returned" do
|
135
|
+
@twitter.should_receive(:bless_models).with(@user).and_return(@user)
|
136
|
+
@twitter.my(:info)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should return expected user object" do
|
140
|
+
user = @twitter.my(:info)
|
141
|
+
user.should eql(@user)
|
142
|
+
end
|
143
|
+
|
144
|
+
after(:each) do
|
145
|
+
nilize(@request, @response, @connection, @twitter, @user, @screen_name)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
describe Twitter::Client, "#my(:friends)" do
|
150
|
+
before(:each) do
|
151
|
+
@twitter = client_context
|
152
|
+
@screen_name = @twitter.instance_eval("@login")
|
153
|
+
@friends = [
|
154
|
+
Twitter::User.new(:screen_name => 'lucy_snowe'),
|
155
|
+
Twitter::User.new(:screen_name => 'jane_eyre'),
|
156
|
+
Twitter::User.new(:screen_name => 'tess_derbyfield'),
|
157
|
+
Twitter::User.new(:screen_name => 'elizabeth_jane_newson'),
|
158
|
+
]
|
159
|
+
@json = JSON.unparse(@friends.collect {|f| f.to_hash })
|
160
|
+
@request = mas_net_http_get(:basic_auth => nil)
|
161
|
+
@response = mas_net_http_response(:success, @json)
|
162
|
+
@connection = mas_net_http(@response)
|
163
|
+
@uris = Twitter::Client.class_eval("@@USER_URIS")
|
164
|
+
@twitter.stub!(:create_http_get_request).and_return(@request)
|
165
|
+
Twitter::User.stub!(:unmarshal).and_return(@friends)
|
166
|
+
Net::HTTP.stub!(:new).and_return(@connection)
|
167
|
+
end
|
168
|
+
|
169
|
+
it "should create expected HTTP GET request" do
|
170
|
+
@twitter.should_receive(:create_http_get_request).with(@uris[:friends], :id => @screen_name).and_return(@request)
|
171
|
+
@twitter.my(:friends)
|
172
|
+
end
|
173
|
+
|
174
|
+
it "should bless models returned" do
|
175
|
+
@twitter.should_receive(:bless_models).with(@friends).and_return(@friends)
|
176
|
+
@twitter.my(:friends)
|
177
|
+
end
|
178
|
+
|
179
|
+
it "should return expected Array of friends" do
|
180
|
+
friends = @twitter.my(:friends)
|
181
|
+
friends.should eql(@friends)
|
182
|
+
end
|
183
|
+
|
184
|
+
after(:each) do
|
185
|
+
nilize(@request, @response, @connection, @twitter, @friends, @screen_name)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
describe Twitter::Client, "#my(:invalid_action)" do
|
190
|
+
before(:each) do
|
191
|
+
@twitter = client_context
|
192
|
+
end
|
193
|
+
|
194
|
+
it "should raise ArgumentError for invalid user action" do
|
195
|
+
lambda {
|
196
|
+
@twitter.my(:crap)
|
197
|
+
}.should raise_error(ArgumentError)
|
198
|
+
end
|
199
|
+
|
200
|
+
after(:each) do
|
201
|
+
nilize(@twitter)
|
202
|
+
end
|
203
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe Twitter::Client, ".configure" do
|
4
|
+
it "should respond to :configure class method" do
|
5
|
+
Twitter::Client.respond_to?(:configure).should be(true)
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should not accept calls that do not specify blocks" do
|
9
|
+
lambda {
|
10
|
+
Twitter::Client.configure()
|
11
|
+
}.should raise_error(ArgumentError)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe Twitter::Client, ".configure with mocked @config" do
|
16
|
+
before(:each) do
|
17
|
+
@block_invoked = false
|
18
|
+
@conf_yielded = false
|
19
|
+
@conf = mock(Twitter::Config)
|
20
|
+
@block = Proc.new do |conf|
|
21
|
+
@block_invoked = true
|
22
|
+
@conf_yielded = true if conf.is_a?(Twitter::Config)
|
23
|
+
end
|
24
|
+
Twitter::Config.stub!(:new).and_return(@conf)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should not raise an error when passing block" do
|
28
|
+
lambda {
|
29
|
+
Twitter::Client.configure(&@block)
|
30
|
+
}.should_not raise_error
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should yield a Twitter::Client object to block" do
|
34
|
+
Twitter::Client.configure(&@block)
|
35
|
+
@block_invoked.should be(true)
|
36
|
+
@conf_yielded.should be(true)
|
37
|
+
end
|
38
|
+
|
39
|
+
after(:each) do
|
40
|
+
nilize(@block, @block_invoked, @conf, @conf_yielded)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe Twitter::Config, "#eql?" do
|
45
|
+
before(:each) do
|
46
|
+
@protocol = :ssl
|
47
|
+
@host = 'twitter.com'
|
48
|
+
@port = 443
|
49
|
+
@proxy_host = 'myproxy.host'
|
50
|
+
@proxy_port = 8080
|
51
|
+
attrs = {
|
52
|
+
:protocol => @protocol,
|
53
|
+
:host => @host,
|
54
|
+
:port => @port,
|
55
|
+
:proxy_host => @proxy_host,
|
56
|
+
:proxy_port => @proxy_port,
|
57
|
+
}
|
58
|
+
@obj = Twitter::Config.new(attrs)
|
59
|
+
@other = Twitter::Config.new(attrs)
|
60
|
+
|
61
|
+
@different = stubbed_twitter_config(Twitter::Config.new, attrs.merge(:proxy_host => 'different.proxy'))
|
62
|
+
@same = @obj
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should return true for two logically equivalent objects" do
|
66
|
+
@obj.should be_eql(@other)
|
67
|
+
@other.should be_eql(@obj)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should return false for two logically different objects" do
|
71
|
+
@obj.should_not be_eql(@different)
|
72
|
+
@different.should_not be_eql(@obj)
|
73
|
+
@other.should_not be_eql(@different)
|
74
|
+
@different.should_not be_eql(@other)
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should return true for references to the same object in memory" do
|
78
|
+
@obj.should eql(@same)
|
79
|
+
@same.should eql(@obj)
|
80
|
+
@other.should eql(@other)
|
81
|
+
end
|
82
|
+
|
83
|
+
after(:each) do
|
84
|
+
nilize(@protocol, @host, @port, @proxy_host, @proxy_port, @obj, @other, @different, @same)
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe "Twitter::ClassUtilMixin mixed-in class" do
|
4
|
+
before(:each) do
|
5
|
+
class TestClass
|
6
|
+
include Twitter::ClassUtilMixin
|
7
|
+
attr_accessor :var1, :var2, :var3
|
8
|
+
end
|
9
|
+
@init_hash = { :var1 => 'val1', :var2 => 'val2', :var3 => 'val3' }
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should have Twitter::ClassUtilMixin as an included module" do
|
13
|
+
TestClass.included_modules.member?(Twitter::ClassUtilMixin).should be(true)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should set attributes passed in the hash to TestClass.new" do
|
17
|
+
test = TestClass.new(@init_hash)
|
18
|
+
@init_hash.each do |key, val|
|
19
|
+
test.send(key).should eql(val)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should not set attributes passed in the hash that are not attributes in TestClass.new" do
|
24
|
+
test = nil
|
25
|
+
lambda { test = TestClass.new(@init_hash.merge(:var4 => 'val4')) }.should_not raise_error
|
26
|
+
test.respond_to?(:var4).should be(false)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "Twitter::RESTError#to_s" do
|
31
|
+
before(:each) do
|
32
|
+
@hash = { :code => 200, :message => 'OK', :uri => 'http://test.host/bla' }
|
33
|
+
@error = Twitter::RESTError.new(@hash)
|
34
|
+
@expected_message = "HTTP #{@hash[:code]}: #{@hash[:message]} at #{@hash[:uri]}"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should return @expected_message" do
|
38
|
+
@error.to_s.should eql(@expected_message)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "Twitter::Status#eql?" do
|
43
|
+
before(:each) do
|
44
|
+
@id = 34329594003
|
45
|
+
@attr_hash = { :text => 'Status', :id => @id,
|
46
|
+
:user => { :name => 'Tess',
|
47
|
+
:description => "Unfortunate D'Urberville",
|
48
|
+
:location => 'Dorset',
|
49
|
+
:url => nil,
|
50
|
+
:id => 34320304,
|
51
|
+
:screen_name => 'maiden_no_more' },
|
52
|
+
:created_at => 'Wed May 02 03:04:54 +0000 2007'}
|
53
|
+
@obj = Twitter::Status.new @attr_hash
|
54
|
+
@other = Twitter::Status.new @attr_hash
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should return true when non-transient object attributes are eql?" do
|
58
|
+
@obj.should eql(@other)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should return false when not all non-transient object attributes are eql?" do
|
62
|
+
@other.created_at = Time.now.to_s
|
63
|
+
@obj.should_not eql(@other)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should return true when comparing same object to itself" do
|
67
|
+
@obj.should eql(@obj)
|
68
|
+
@other.should eql(@other)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "Twitter::User#eql?" do
|
73
|
+
before(:each) do
|
74
|
+
@attr_hash = { :name => 'Elizabeth Jane Newson-Henshard',
|
75
|
+
:description => "Wronged 'Daughter'",
|
76
|
+
:location => 'Casterbridge',
|
77
|
+
:url => nil,
|
78
|
+
:id => 6748302,
|
79
|
+
:screen_name => 'mayors_daughter_or_was_she?' }
|
80
|
+
@obj = Twitter::User.new @attr_hash
|
81
|
+
@other = Twitter::User.new @attr_hash
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should return true when non-transient object attributes are eql?" do
|
85
|
+
@obj.should eql(@other)
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should return false when not all non-transient object attributes are eql?" do
|
89
|
+
@other.id = 1
|
90
|
+
@obj.should_not eql(@other)
|
91
|
+
@obj.eql?(@other).should be(false)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should return true when comparing same object to itself" do
|
95
|
+
@obj.should eql(@obj)
|
96
|
+
@other.should eql(@other)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe "Twitter::ClassUtilMixin#require_block" do
|
101
|
+
before(:each) do
|
102
|
+
class TestClass
|
103
|
+
include Twitter::ClassUtilMixin
|
104
|
+
end
|
105
|
+
@test_subject = TestClass.new
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should respond to :require_block" do
|
109
|
+
@test_subject.should respond_to(:require_block)
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should raise ArgumentError when block not given" do
|
113
|
+
lambda {
|
114
|
+
@test_subject.send(:require_block, false)
|
115
|
+
}.should raise_error(ArgumentError)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should not raise ArgumentError when block is given" do
|
119
|
+
lambda {
|
120
|
+
@test_subject.send(:require_block, true)
|
121
|
+
}.should_not raise_error(ArgumentError)
|
122
|
+
end
|
123
|
+
|
124
|
+
after(:each) do
|
125
|
+
@test_subject = nil
|
126
|
+
end
|
127
|
+
end
|