spec/cli/helper_spec.rb in jnunemaker-twitter-0.3.8 vs spec/cli/helper_spec.rb in jnunemaker-twitter-0.4.0
- old
+ new
@@ -6,25 +6,31 @@
def say(str)
puts str
end
+class Tweet < OpenStruct
+ attr_accessor :id
+end
+
describe Twitter::CLI::Helpers do
include Twitter::CLI::Helpers
describe "outputting tweets" do
before do
Configuration.stub!(:[]=).and_return(true)
@collection = [
- OpenStruct.new(
- :text => 'This is my long message that I want to see formatted ooooh so pretty with a few words on each line so it is easy to scan.',
+ Tweet.new(
+ :id => 1,
+ :text => 'This is my long message that I want to see formatted ooooh so pretty with a few words on each line so it is easy to scan.',
:created_at => Time.mktime(2008, 5, 1, 10, 15, 00).strftime('%Y-%m-%d %H:%M:%S'),
- :user => OpenStruct.new(:screen_name => 'jnunemaker')
+ :user => OpenStruct.new(:screen_name => 'jnunemaker')
),
- OpenStruct.new(
- :text => 'This is my long message that I want to see formatted ooooh so pretty with a.',
+ Tweet.new(
+ :id => 2,
+ :text => 'This is my long message that I want to see formatted ooooh so pretty with a.',
:created_at => Time.mktime(2008, 4, 1, 10, 15, 00).strftime('%Y-%m-%d %H:%M:%S'),
- :user => OpenStruct.new(:screen_name => 'danielmorrison')
+ :user => OpenStruct.new(:screen_name => 'danielmorrison')
)
]
end
specify "should properly format" do
\ No newline at end of file