Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prevent namespace scoping bugs in Entity classes

  • Loading branch information...
commit def9e9b992ba19ed20195a2e16e57f336a56e0b1 1 parent 979ed71
@sferik authored
View
4 README.md
@@ -160,9 +160,9 @@ vulnerabilities are discovered.
Here are some fun facts about the 3.0 release:
-* The entire library is implemented in just 2,254 lines of code
+* The entire library is implemented in just 2,264 lines of code
* With over 5,000 lines of specs, the spec-to-code ratio is well over 2:1
-* The spec suite contains 658 examples and runs in under 2 seconds on a MacBook
+* The spec suite contains 661 examples and runs in under 2 seconds on a MacBook
* This project has 100% C0 code coverage (the tests execute every line of
source code at least once)
* At the time of release, this library is comprehensive: you can request all
View
6 lib/twitter/entity/hashtag.rb
@@ -1,7 +1,9 @@
require 'twitter/entity'
module Twitter
- class Entity::Hashtag < Twitter::Entity
- attr_reader :text
+ class Entity
+ class Hashtag < Twitter::Entity
+ attr_reader :text
+ end
end
end
View
6 lib/twitter/entity/url.rb
@@ -1,7 +1,9 @@
require 'twitter/entity'
module Twitter
- class Entity::Url < Twitter::Entity
- attr_reader :display_url, :expanded_url, :url
+ class Entity
+ class Url < Twitter::Entity
+ attr_reader :display_url, :expanded_url, :url
+ end
end
end
View
6 lib/twitter/entity/user_mention.rb
@@ -1,7 +1,9 @@
require 'twitter/entity'
module Twitter
- class Entity::UserMention < Twitter::Entity
- attr_reader :id, :name, :screen_name
+ class Entity
+ class UserMention < Twitter::Entity
+ attr_reader :id, :name, :screen_name
+ end
end
end
View
4 spec/twitter/action_factory_spec.rb
@@ -27,6 +27,10 @@
action = Twitter::ActionFactory.fetch_or_new(:action => 'retweet')
action.should be_a Twitter::Action::Retweet
end
+ it "generates a Status" do
+ action = Twitter::ActionFactory.fetch_or_new(:action => 'status')
+ action.should be_a Twitter::Action::Status
+ end
it "raises an ArgumentError when action is not specified" do
lambda do
Twitter::ActionFactory.fetch_or_new
Please sign in to comment.
Something went wrong with that request. Please try again.