tweetwine 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/CHANGELOG.rdoc +6 -0
  2. data/Rakefile +22 -23
  3. data/lib/tweetwine/cli.rb +167 -165
  4. data/lib/tweetwine/config.rb +3 -2
  5. data/lib/tweetwine/exceptions.rb +1 -0
  6. data/lib/tweetwine/version.rb +1 -1
  7. data/project.rb +16 -16
  8. data/test/fixture/{config_example.yaml → config_integration.yaml} +0 -0
  9. data/test/fixture/oauth.rb +11 -11
  10. data/test/{test_helper.rb → helper.rb} +16 -7
  11. data/test/{example/authorization_example.rb → integration/authorization_test.rb} +17 -17
  12. data/test/integration/global_options_test.rb +67 -0
  13. data/test/integration/helper.rb +70 -0
  14. data/test/integration/invalid_config_file_test.rb +28 -0
  15. data/test/integration/search_statuses_test.rb +81 -0
  16. data/test/integration/show_followers_test.rb +24 -0
  17. data/test/integration/show_friends_test.rb +24 -0
  18. data/test/integration/show_home_test.rb +47 -0
  19. data/test/integration/show_mentions_test.rb +24 -0
  20. data/test/integration/show_user_test.rb +48 -0
  21. data/test/integration/update_status_test.rb +199 -0
  22. data/test/integration/use_http_proxy_test.rb +71 -0
  23. data/test/{example/user_help_example.rb → integration/user_help_test.rb} +36 -36
  24. data/test/unit/character_encoding_test.rb +19 -15
  25. data/test/unit/cli_test.rb +9 -10
  26. data/test/unit/config_test.rb +73 -71
  27. data/test/unit/helper.rb +108 -0
  28. data/test/unit/http_test.rb +39 -39
  29. data/test/unit/oauth_test.rb +15 -16
  30. data/test/unit/obfuscate_test.rb +4 -4
  31. data/test/unit/option_parser_test.rb +12 -12
  32. data/test/unit/promise_test.rb +10 -10
  33. data/test/unit/support_test.rb +44 -45
  34. data/test/unit/tweet_helper.rb +1 -1
  35. data/test/unit/tweet_test.rb +42 -42
  36. data/test/unit/twitter_test.rb +300 -303
  37. data/test/unit/ui_test.rb +310 -312
  38. data/test/unit/uri_test.rb +7 -7
  39. data/test/unit/url_shortener_test.rb +77 -79
  40. data/tweetwine.gemspec +6 -15
  41. metadata +55 -145
  42. data/test/example/example_helper.rb +0 -58
  43. data/test/example/global_options_example.rb +0 -64
  44. data/test/example/search_statuses_example.rb +0 -76
  45. data/test/example/show_followers_example.rb +0 -24
  46. data/test/example/show_friends_example.rb +0 -24
  47. data/test/example/show_home_example.rb +0 -44
  48. data/test/example/show_mentions_example.rb +0 -24
  49. data/test/example/show_user_example.rb +0 -44
  50. data/test/example/update_status_example.rb +0 -183
  51. data/test/example/use_http_proxy_example.rb +0 -68
  52. data/test/unit/unit_helper.rb +0 -111
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 0.4.2 released 2011-05-18
2
+
3
+ * Fail graciously if config file is invalid
4
+ * Removed setting deprecated gemspec attribute (has_rdoc)
5
+ * Cleaned tests
6
+
1
7
  === 0.4.1 released 2011-03-23
2
8
 
3
9
  * Handle socket errors just like connection errors
data/Rakefile CHANGED
@@ -3,14 +3,15 @@
3
3
  require File.expand_path('project', File.dirname(__FILE__))
4
4
 
5
5
  require 'rake/clean'
6
+ require 'shellwords'
6
7
 
7
8
  namespace :gem do
8
- CLOBBER.include "#{Project.name}-*.gem"
9
+ CLOBBER.include "#{Project.spec[:name]}-*.gem"
9
10
 
10
- current_gem = "#{Project.name}-#{Project.version}.gem"
11
+ current_gem = "#{Project.spec[:name]}-#{Project.spec[:version]}.gem"
11
12
 
12
13
  file current_gem do |f|
13
- sh %{gem build #{Project.name}.gemspec}
14
+ sh %{gem build #{Project.spec[:name]}.gemspec}
14
15
  end
15
16
 
16
17
  desc "Package the software as a gem"
@@ -23,62 +24,60 @@ namespace :gem do
23
24
 
24
25
  desc "Uninstall the gem"
25
26
  task :uninstall => :clean do
26
- sh %{gem uninstall #{Project.name}}
27
+ sh %{gem uninstall #{Project.spec[:name]}}
27
28
  end
28
29
  end
29
30
 
30
31
  namespace :man do
31
- CLOBBER.include "#{Project.dirs.man}/#{Project.name}.?", "#{Project.dirs.man}/#{Project.name}.?.html"
32
+ CLOBBER.include "#{Project.dirs[:man]}/#{Project.spec[:name]}.?", "#{Project.dirs[:man]}/#{Project.spec[:name]}.?.html"
32
33
 
33
34
  desc "Build the manual"
34
35
  task :build do
35
- sh %{ronn -br5 --manual='#{Project.name.capitalize} Manual' --organization='#{Project.authors.first}' #{Project.dirs.man}/*.ronn}
36
+ sh %{ronn -br5 --manual='#{Project.spec[:name].capitalize} Manual' --organization='#{Project.spec[:authors].first}' #{Project.dirs[:man]}/*.ronn}
36
37
  end
37
38
 
38
39
  desc "Show the manual section 7"
39
40
  task :show => :build do
40
- sh %{man #{Project.dirs.man}/#{Project.name}.7}
41
+ sh %{man #{Project.dirs[:man]}/#{Project.spec[:name]}.7}
41
42
  end
42
43
  end
43
44
 
44
- CLOBBER.include Project.dirs.rdoc
45
+ CLOBBER.include Project.dirs[:rdoc]
45
46
 
46
47
  desc "Generate RDoc"
47
48
  task :rdoc do
48
- sh %{rdoc --encoding=UTF-8 --line-numbers --title='#{Project.title}' --output=#{Project.dirs.rdoc} *.rdoc LICENSE.txt lib}
49
+ sh %{rdoc --encoding=UTF-8 --line-numbers --title='#{Project.extra[:title]}' --output=#{Project.dirs[:rdoc]} *.rdoc LICENSE.txt lib}
49
50
  end
50
51
 
51
52
  namespace :test do
52
53
  def create_test_task(type, options = {})
53
54
  base_dir = options[:base_dir]
54
- file_glob = options[:file_glob]
55
+ file_glob = options[:file_glob] || '**/*_test.rb'
55
56
  test_desc = options[:desc] || "Run #{type} tests"
56
- includes = ['lib', Project.dirs.test, base_dir].map { |dir| "-I #{dir}" }.join(' ')
57
+ includes = ['lib', Project.dirs[:test]].map { |dir| "-I #{dir}" }.join(' ')
57
58
  warn_opt = options[:warn] ? '-w' : ''
58
59
 
59
60
  desc test_desc
60
61
  task type do
61
- file_name_offset = base_dir.size + 1
62
+ file_name_offset = Project.dirs[:test].size + 1
62
63
  neg_dotrb_suffix = -'.rb'.size - 1
63
- tests = FileList["#{base_dir}/#{file_glob}"].
64
- map { |file| '"' << file[file_name_offset..neg_dotrb_suffix] << '"' }.
65
- join(' ')
64
+ tests = Dir["#{base_dir}/#{file_glob}"].
65
+ map { |file| file[file_name_offset..neg_dotrb_suffix] }.
66
+ shelljoin
66
67
  sh %{bundle exec ruby #{warn_opt} #{includes} -e 'ARGV.each { |f| require f }' #{tests}}
67
68
  end
68
69
  end
69
70
 
70
71
  create_test_task :unit,
71
- :base_dir => "#{Project.dirs.test}/unit",
72
- :file_glob => '**/*_test.rb',
72
+ :base_dir => "#{Project.dirs[:test]}/unit",
73
73
  :warn => true
74
- create_test_task :example,
75
- :base_dir => "#{Project.dirs.test}/example",
76
- :file_glob => '**/*_example.rb',
77
- :desc => 'Run integration/example tests',
74
+
75
+ create_test_task :integration,
76
+ :base_dir => "#{Project.dirs[:test]}/integration",
78
77
  :warn => false
79
78
 
80
79
  desc "Run all tests"
81
- task :all => [:unit, :example]
80
+ task :all => [:unit, :integration]
82
81
  end
83
82
 
84
83
  desc "Find code smells"
@@ -88,7 +87,7 @@ end
88
87
 
89
88
  desc "Show parts of the project tagged as incomplete"
90
89
  task :todo do
91
- FileList["**/*.*"].egrep /(TODO|FIXME)/
90
+ FileList["**/*.*"].egrep(/(TODO|FIXME)/)
92
91
  end
93
92
 
94
93
  task :default => :"test:all"
data/lib/tweetwine/cli.rb CHANGED
@@ -108,8 +108,10 @@ module Tweetwine
108
108
  private
109
109
 
110
110
  def init(args, overriding_default_conf = nil)
111
- @config, @http, @oauth, @twitter, @ui, @url_shortener = nil # reset
111
+ @config, @http, @oauth, @twitter, @url_shortener = nil # reset
112
+ @ui = UI.new # preload with defaults if config init fails
112
113
  @config = read_config(args, overriding_default_conf)
114
+ @ui = nil # reset, reload lazily with real config
113
115
  end
114
116
 
115
117
  def run(args)
@@ -137,113 +139,112 @@ module Tweetwine
137
139
  options
138
140
  end
139
141
  end
140
- end
141
142
 
142
- class Command
143
- class << self
144
- def inherited(child)
145
- # Silence warnings about uninitialized variables if a child does not
146
- # set its about, name, or usage.
147
- child.instance_eval do
148
- @about, @name, @usage = nil
143
+ class Command
144
+ class << self
145
+ def inherited(child)
146
+ # Silence warnings about uninitialized variables if a child does not
147
+ # set its about, name, or usage.
148
+ child.instance_eval do
149
+ @about, @name, @usage = nil
150
+ end
149
151
  end
150
- end
151
152
 
152
- def about(description = nil)
153
- return @about unless description
154
- @about = description.chomp
155
- end
153
+ def about(description = nil)
154
+ return @about unless description
155
+ @about = description.chomp
156
+ end
156
157
 
157
- def register(*names)
158
- @name = names.first
159
- CLI.register_command(self, names)
160
- end
158
+ def register(*names)
159
+ @name = names.first
160
+ CLI.register_command(self, names)
161
+ end
161
162
 
162
- def name
163
- @name
164
- end
163
+ def name
164
+ @name
165
+ end
165
166
 
166
- # Usage description for the command, use if overriding #parse.
167
- def usage(description = nil)
168
- return @usage unless description
169
- @usage = description
170
- end
167
+ # Usage description for the command, use if overriding #parse.
168
+ def usage(description = nil)
169
+ return @usage unless description
170
+ @usage = description
171
+ end
171
172
 
172
- def show_usage(about_cmd = self)
173
- about = about_cmd.about
174
- name = about_cmd.name
175
- usage = about_cmd.usage
176
- result = <<-END
173
+ def show_usage(about_cmd = self)
174
+ about = about_cmd.about
175
+ name = about_cmd.name
176
+ usage = about_cmd.usage
177
+ result = <<-END
177
178
  #{about}
178
179
 
179
180
  Usage: #{CLI::EXEC_NAME} #{name} #{usage}
180
- END
181
- CLI.ui.info result.strip!
182
- end
181
+ END
182
+ CLI.ui.info result.strip!
183
+ end
183
184
 
184
- def abort_with_usage
185
- show_usage
186
- exit CommandLineError.status_code
185
+ def abort_with_usage
186
+ show_usage
187
+ exit CommandLineError.status_code
188
+ end
187
189
  end
188
- end
189
190
 
190
- def initialize(args)
191
- parsing_succeeded = parse(args)
192
- self.class.abort_with_usage unless parsing_succeeded
193
- end
191
+ def initialize(args)
192
+ parsing_succeeded = parse(args)
193
+ self.class.abort_with_usage unless parsing_succeeded
194
+ end
194
195
 
195
- # Default behavior, which succeeds always; override for real argument
196
- # parsing if the command needs arguments.
197
- def parse(args)
198
- true
196
+ # Default behavior, which succeeds always; override for real argument
197
+ # parsing if the command needs arguments.
198
+ def parse(args)
199
+ true
200
+ end
199
201
  end
200
- end
201
202
 
202
- class HelpCommand < Command
203
- register "help"
204
- about "Show help and exit. Try it with <command> argument."
205
- usage <<-END
203
+ class HelpCommand < Command
204
+ register "help"
205
+ about "Show help and exit. Try it with <command> argument."
206
+ usage <<-END
206
207
  [<command>]
207
208
 
208
209
  If <command> is given, show specific help about that command. If no
209
210
  <command> is given, show general help.
210
- END
211
-
212
- def parse(args)
213
- # Did we arrive here via '-h' option? If so, we cannot have
214
- # +proposed_command+ because '-h' does not take an argument. Otherwise,
215
- # try to read the argument.
216
- proposed_command = args.include?('-h') ? nil : args.shift
217
- if proposed_command
218
- @command = CLI.find_command proposed_command
219
- CLI.ui.error "unknown command: #{proposed_command}\n\n" unless @command
220
- @command
221
- else
222
- @command = nil
223
- true
211
+ END
212
+
213
+ def parse(args)
214
+ # Did we arrive here via '-h' option? If so, we cannot have
215
+ # +proposed_command+ because '-h' does not take an argument. Otherwise,
216
+ # try to read the argument.
217
+ proposed_command = args.include?('-h') ? nil : args.shift
218
+ if proposed_command
219
+ @command = CLI.find_command proposed_command
220
+ CLI.ui.error "unknown command: #{proposed_command}\n\n" unless @command
221
+ @command
222
+ else
223
+ @command = nil
224
+ true
225
+ end
224
226
  end
225
- end
226
227
 
227
- def run
228
- if @command
229
- show_command_help
230
- else
231
- show_general_help
228
+ def run
229
+ if @command
230
+ show_command_help
231
+ else
232
+ show_general_help
233
+ end
232
234
  end
233
- end
234
235
 
235
- private
236
+ private
236
237
 
237
- def show_command_help
238
- self.class.show_usage @command
239
- end
238
+ def show_command_help
239
+ self.class.show_usage @command
240
+ end
240
241
 
241
- def show_general_help
242
- command_descriptions = CLI.commands[:primaries].
243
- entries.
244
- sort { |a, b| a.first.to_s <=> b.first.to_s }.
245
- map { |cmd, klass| [cmd, klass.about] }
246
- CLI.ui.info <<-END
242
+ def show_general_help
243
+ command_descriptions = CLI.commands[:primaries].
244
+ entries.
245
+ sort { |a, b| a.first.to_s <=> b.first.to_s }.
246
+ map { |cmd, klass| [cmd, klass.about] }
247
+ CLI.ui.info <<-END
247
248
  #{Tweetwine.summary}
248
249
 
249
250
  Usage: #{CLI::EXEC_NAME} [global_options...] [<command>] [command_options...]
@@ -255,130 +256,131 @@ Usage: #{CLI::EXEC_NAME} [global_options...] [<command>] [command_options...]
255
256
  Commands:
256
257
 
257
258
  #{command_descriptions.map { |cmd, desc| " %-14s%s" % [cmd, desc] }.join("\n") }
258
- END
259
+ END
260
+ end
259
261
  end
260
- end
261
262
 
262
- class HomeCommand < Command
263
- register "home", "h"
264
- about "Show authenticated user's home timeline (the default command)."
263
+ class HomeCommand < Command
264
+ register "home", "h"
265
+ about "Show authenticated user's home timeline (the default command)."
265
266
 
266
- def run
267
- CLI.twitter.home
267
+ def run
268
+ CLI.twitter.home
269
+ end
268
270
  end
269
- end
270
271
 
271
- class FollowersCommand < Command
272
- register "followers", "fo"
273
- about "Show authenticated user's followers and their latest tweets."
272
+ class FollowersCommand < Command
273
+ register "followers", "fo"
274
+ about "Show authenticated user's followers and their latest tweets."
274
275
 
275
- def run
276
- CLI.twitter.followers
276
+ def run
277
+ CLI.twitter.followers
278
+ end
277
279
  end
278
- end
279
280
 
280
- class FriendsCommand < Command
281
- register "friends", "fr"
282
- about "Show authenticated user's friends and their latest tweets."
281
+ class FriendsCommand < Command
282
+ register "friends", "fr"
283
+ about "Show authenticated user's friends and their latest tweets."
283
284
 
284
- def run
285
- CLI.twitter.friends
285
+ def run
286
+ CLI.twitter.friends
287
+ end
286
288
  end
287
- end
288
289
 
289
- class MentionsCommand < Command
290
- register "mentions", "men", "m"
291
- about "Show latest tweets that mention or are replies to the authenticated user."
290
+ class MentionsCommand < Command
291
+ register "mentions", "men", "m"
292
+ about "Show latest tweets that mention or are replies to the authenticated user."
292
293
 
293
- def run
294
- CLI.twitter.mentions
294
+ def run
295
+ CLI.twitter.mentions
296
+ end
295
297
  end
296
- end
297
298
 
298
- class SearchCommand < Command
299
- def self.parser
300
- @parser ||= OptionParser.new do |parser, options|
301
- parser.on '-a', '--and', 'All words match (default).' do
302
- options[:operator] = :and
303
- end
304
- parser.on '-o', '--or', 'Any word matches.' do
305
- options[:operator] = :or
299
+ class SearchCommand < Command
300
+ def self.parser
301
+ @parser ||= OptionParser.new do |parser, options|
302
+ parser.on '-a', '--and', 'All words match (default).' do
303
+ options[:operator] = :and
304
+ end
305
+ parser.on '-o', '--or', 'Any word matches.' do
306
+ options[:operator] = :or
307
+ end
306
308
  end
307
309
  end
308
- end
309
310
 
310
- register "search", "s"
311
- about "Search latest public tweets."
312
- usage(Promise.new {<<-END
311
+ register "search", "s"
312
+ about "Search latest public tweets."
313
+ usage(Promise.new {<<-END
313
314
  [--all | --or] <word>...
314
315
 
315
316
  Command options:
316
317
 
317
318
  #{parser.help}
318
- END
319
- })
320
-
321
- def parse(args)
322
- options = self.class.parser.parse(args)
323
- @operator = options[:operator]
324
- @words = args
325
- if @words.empty?
326
- CLI.ui.error "No search words.\n\n"
327
- false
328
- else
329
- true
319
+ END
320
+ })
321
+
322
+ def parse(args)
323
+ options = self.class.parser.parse(args)
324
+ @operator = options[:operator]
325
+ @words = args
326
+ if @words.empty?
327
+ CLI.ui.error "No search words.\n\n"
328
+ false
329
+ else
330
+ true
331
+ end
330
332
  end
331
- end
332
333
 
333
- def run
334
- CLI.twitter.search @words, @operator
334
+ def run
335
+ CLI.twitter.search @words, @operator
336
+ end
335
337
  end
336
- end
337
338
 
338
- class UpdateCommand < Command
339
- register "update", "up"
340
- about "Send new tweet."
341
- usage <<-END
339
+ class UpdateCommand < Command
340
+ register "update", "up"
341
+ about "Send new tweet."
342
+ usage <<-END
342
343
  [<status>]
343
344
 
344
345
  If <status> is not given, read the contents for the tweet from STDIN.
345
- END
346
+ END
346
347
 
347
- def parse(args)
348
- @msg = args.join(' ')
349
- args.clear
350
- true
351
- end
348
+ def parse(args)
349
+ @msg = args.join(' ')
350
+ args.clear
351
+ true
352
+ end
352
353
 
353
- def run
354
- CLI.twitter.update @msg
354
+ def run
355
+ CLI.twitter.update @msg
356
+ end
355
357
  end
356
- end
357
358
 
358
- class UserCommand < Command
359
- register "user", "usr"
360
- about "Show user's timeline."
361
- usage <<-END
359
+ class UserCommand < Command
360
+ register "user", "usr"
361
+ about "Show user's timeline."
362
+ usage <<-END
362
363
  [<username>]
363
364
 
364
365
  If <username> is not given, show authenticated user's timeline.
365
- END
366
+ END
366
367
 
367
- def parse(args)
368
- @user = args.empty? ? CLI.config[:username] : args.shift
369
- end
368
+ def parse(args)
369
+ @user = args.empty? ? CLI.config[:username] : args.shift
370
+ end
370
371
 
371
- def run
372
- CLI.twitter.user(@user)
372
+ def run
373
+ CLI.twitter.user(@user)
374
+ end
373
375
  end
374
- end
375
376
 
376
- class VersionCommand < Command
377
- register "version", "ver", "v"
378
- about "Show program version and exit."
377
+ class VersionCommand < Command
378
+ register "version", "ver", "v"
379
+ about "Show program version and exit."
379
380
 
380
- def run
381
- CLI.ui.info "tweetwine #{Tweetwine.version}"
381
+ def run
382
+ CLI.ui.info "tweetwine #{Tweetwine.version}"
383
+ end
382
384
  end
383
385
  end
384
386
  end
@@ -58,8 +58,9 @@ module Tweetwine
58
58
  end
59
59
 
60
60
  def self.parse_config_file(config_file)
61
- options = File.open(config_file, 'r') { |io| YAML.load(io) }
62
- Support.symbolize_hash_keys(options)
61
+ config = YAML.load_file config_file
62
+ raise ConfigError, "invalid config file; it must be a mapping style YAML document: #{config_file}" unless config.is_a? Hash
63
+ Support.symbolize_hash_keys(config)
63
64
  end
64
65
  end
65
66
  end
@@ -15,6 +15,7 @@ module Tweetwine
15
15
  end
16
16
  end
17
17
 
18
+ class ConfigError < Error; status_code(12); end
18
19
  class CommandLineError < Error; status_code(13); end
19
20
  class UnknownCommandError < Error; status_code(14); end
20
21
 
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Tweetwine
4
- VERSION = '0.4.1'.freeze
4
+ VERSION = '0.4.2'.freeze
5
5
 
6
6
  class << self
7
7
  def version
data/project.rb CHANGED
@@ -1,30 +1,30 @@
1
1
  # coding: utf-8
2
2
 
3
- require 'ostruct'
4
-
5
3
  name = 'tweetwine'
6
4
  $LOAD_PATH.unshift File.expand_path('lib', File.dirname(__FILE__))
7
5
  require "#{name}/version"
8
6
 
9
- Project = OpenStruct.new({
10
- :name => name,
11
- :version => Tweetwine.version.dup,
12
- :summary => Tweetwine.summary,
13
- :description => '',
14
- :email => 'tkareine@gmail.com',
15
- :homepage => 'https://github.com/tkareine/tweetwine',
16
- :authors => ['Tuomas Kareinen'],
17
- :dirs => OpenStruct.new({
7
+ Project = Struct.new('Project', :spec, :dirs, :extra).new(
8
+ {
9
+ :name => name,
10
+ :version => Tweetwine.version.dup,
11
+ :summary => Tweetwine.summary,
12
+ :description => '',
13
+ :email => 'tkareine@gmail.com',
14
+ :homepage => 'https://github.com/tkareine/tweetwine',
15
+ :authors => ['Tuomas Kareinen']
16
+ },
17
+ {
18
18
  :man => 'man',
19
19
  :rdoc => 'rdoc',
20
20
  :test => 'test'
21
- }).freeze
22
- })
21
+ },
22
+ {}
23
+ )
23
24
 
24
- Project.description = <<-END
25
+ Project.spec[:description] = <<-END
25
26
  A simple but tasty Twitter agent for command line use, designed for quickly
26
27
  showing the latest tweets.
27
28
  END
28
- Project.title = "#{Project.name} #{Project.version}"
29
29
 
30
- Project.freeze
30
+ Project.extra[:title] = "#{Project.spec[:name]} #{Project.spec[:version]}"
@@ -4,17 +4,17 @@ module Tweetwine::Test
4
4
 
5
5
  module Fixture
6
6
  module OAuth
7
- METHOD = :post
8
- REQUEST_TOKEN_KEY = 'ManManManManManManManManManManManManManM'
9
- REQUEST_TOKEN_SECRET = '3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3'
10
- REQUEST_TOKEN_RESPONSE = "oauth_token=#{REQUEST_TOKEN_KEY}&oauth_token_secret=#{REQUEST_TOKEN_SECRET}&oauth_callback_confirmed=true"
11
- REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
12
- ACCESS_TOKEN_KEY = '111111111-XyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzX'
13
- ACCESS_TOKEN_SECRET = '4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x'
14
- ACCESS_TOKEN_RESPONSE = "oauth_token=#{ACCESS_TOKEN_KEY}&oauth_token_secret=#{ACCESS_TOKEN_SECRET}&user_id=42&screen_name=fooman"
15
- ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
16
- AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token=#{REQUEST_TOKEN_KEY}"
17
- PIN = '12345678'
7
+ METHOD = :post
8
+ REQUEST_TOKEN_KEY = 'ManManManManManManManManManManManManManM'
9
+ REQUEST_TOKEN_SECRET = '3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3'
10
+ REQUEST_TOKEN_RESPONSE = "oauth_token=#{REQUEST_TOKEN_KEY}&oauth_token_secret=#{REQUEST_TOKEN_SECRET}&oauth_callback_confirmed=true"
11
+ REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
12
+ ACCESS_TOKEN_KEY = '111111111-XyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzX'
13
+ ACCESS_TOKEN_SECRET = '4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x'
14
+ ACCESS_TOKEN_RESPONSE = "oauth_token=#{ACCESS_TOKEN_KEY}&oauth_token_secret=#{ACCESS_TOKEN_SECRET}&user_id=42&screen_name=fooman"
15
+ ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
16
+ AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token=#{REQUEST_TOKEN_KEY}"
17
+ PIN = '12345678'
18
18
  end
19
19
  end
20
20