typingpool 0.8.11 → 0.8.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/bin/tp-assign +5 -4
  3. data/bin/tp-collect +16 -6
  4. data/bin/tp-finish +5 -4
  5. data/bin/tp-make +5 -4
  6. data/bin/tp-review +52 -26
  7. data/lib/typingpool/test.rb +4 -126
  8. data/lib/typingpool/test/fixtures/tp_collect_id.txt +1 -1
  9. data/lib/typingpool/test/fixtures/tp_collect_sandbox-assignment.csv +7 -8
  10. data/lib/typingpool/test/fixtures/tp_review2a_id.txt +1 -0
  11. data/lib/typingpool/test/fixtures/tp_review2a_sandbox-assignment.csv +7 -0
  12. data/lib/typingpool/test/fixtures/tp_review2b_id.txt +1 -0
  13. data/lib/typingpool/test/fixtures/tp_review2b_sandbox-assignment.csv +7 -0
  14. data/lib/typingpool/test/fixtures/tp_review3_id.txt +1 -0
  15. data/lib/typingpool/test/fixtures/tp_review3_sandbox-assignment.csv +7 -0
  16. data/lib/typingpool/test/fixtures/tp_review_id.txt +1 -1
  17. data/lib/typingpool/test/fixtures/tp_review_sandbox-assignment.csv +7 -8
  18. data/lib/typingpool/test/fixtures/vcr/tp-collect-1.yml +3176 -1814
  19. data/lib/typingpool/test/fixtures/vcr/tp-collect-2.yml +116 -2641
  20. data/lib/typingpool/test/fixtures/vcr/tp-collect-3.yml +119 -2693
  21. data/lib/typingpool/test/fixtures/vcr/tp-review-1.yml +353 -355
  22. data/lib/typingpool/test/fixtures/vcr/tp-review-2.yml +161 -242
  23. data/lib/typingpool/test/fixtures/vcr/tp-review-3.yml +4716 -0
  24. data/lib/typingpool/test/fixtures/vcr/tp-review-4.yml +741 -0
  25. data/lib/typingpool/test/fixtures/vcr/tp-review-5.yml +248 -0
  26. data/lib/typingpool/test/fixtures/vcr/tp-review-6.yml +233 -0
  27. data/lib/typingpool/test/fixtures/vcr/tp-review-7.yml +4479 -0
  28. data/lib/typingpool/test/fixtures/vcr/tp-review-8.yml +188 -0
  29. data/lib/typingpool/test/fixtures/vcr/tp-review-9.yml +187 -0
  30. data/lib/typingpool/test/script.rb +13 -320
  31. data/lib/typingpool/utility/test.rb +175 -0
  32. data/lib/typingpool/utility/test/script.rb +342 -0
  33. data/lib/typingpool/version.rb +1 -1
  34. data/test/make_amazon_question_fixture.rb +1 -1
  35. data/test/make_tp_collect_fixture_1.rb +18 -19
  36. data/test/make_tp_collect_fixture_2.rb +16 -10
  37. data/test/make_tp_collect_fixture_3.rb +15 -9
  38. data/test/make_tp_collect_fixture_4.rb +19 -11
  39. data/test/make_tp_collect_fixture_5.rb +25 -0
  40. data/test/make_tp_collect_fixture_6.rb +22 -0
  41. data/test/make_tp_collect_fixture_7.rb +22 -0
  42. data/test/make_tp_collect_fixture_8.rb +26 -0
  43. data/test/make_tp_review_fixture_1.rb +18 -19
  44. data/test/make_tp_review_fixture_2.rb +43 -24
  45. data/test/make_tp_review_fixture_3.rb +35 -0
  46. data/test/make_tp_review_fixture_4.rb +56 -0
  47. data/test/test_integration_script_1_tp_config.rb +7 -7
  48. data/test/test_integration_script_2_tp_make.rb +12 -12
  49. data/test/test_integration_script_3_tp_assign.rb +23 -21
  50. data/test/test_integration_script_4_tp_review.rb +156 -23
  51. data/test/test_integration_script_5_tp_collect.rb +33 -24
  52. data/test/test_integration_script_6_tp_finish.rb +23 -20
  53. data/test/test_unit_amazon.rb +4 -2
  54. data/test/test_unit_filer.rb +6 -6
  55. data/test/test_unit_project.rb +2 -2
  56. data/test/test_unit_project_local.rb +2 -2
  57. data/test/test_unit_project_remote.rb +3 -1
  58. data/test/test_unit_template.rb +6 -6
  59. data/test/test_unit_test.rb +3 -3
  60. metadata +23 -3
  61. data/lib/typingpool/app/test.rb +0 -69
@@ -1,69 +0,0 @@
1
- module Typingpool
2
- module App
3
- require 'vcr'
4
- require 'uri'
5
- class << self
6
-
7
- #Loads an HTTP mock fixture for playback (default) or
8
- #recording. Used in automated tests. Uses the great VCR gem.
9
- #
10
- #Automatically filters your Config#amazon#key and
11
- #Config#amazon#secret from the recorded fixture, and
12
- #automatically determines the "cassette" name and "cassette
13
- #library" dir from the supplied path.
14
- # ==== Params
15
- # [fixture_path] Path to where you want the HTTP fixture
16
- # recorded, including filename.
17
- # [config] A Config instance, used to extract the
18
- # Config#amazon#secret and Config#amazon#key that
19
- # will be filtered from the fixture.
20
- # [read_only] Default is true. Set to false to enable recording.
21
- # [vcr_params] Default is nil. A hash of params to pass to
22
- # VCR.insert_cassette (same set of params that
23
- # can be passed to VCR.use_cassette), like
24
- # :preserve_exact_body_bytes or
25
- # :match_requests_on => [:url, :matcher]. If nil,
26
- # no extra params will be passed.
27
- # ==== Returns
28
- # Result of calling VCR.insert_cassette.
29
- def vcr_load(fixture_path, config, read_only=true, vcr_params=nil)
30
- VCR.configure do |c|
31
- c.cassette_library_dir = File.dirname(fixture_path)
32
- c.hook_into :webmock
33
- c.filter_sensitive_data('<AWS_KEY>'){ config.amazon.key }
34
- c.filter_sensitive_data('<AWS_SECRET>'){ config.amazon.secret }
35
- c.before_record do |interaction|
36
- if interaction.request.body.size > 10000
37
- interaction.request.body = '<BIG_UPLOAD>'
38
- end
39
- end #c.before_record do...
40
- end
41
- WebMock.allow_net_connect!
42
- opts = {:record => (read_only ? :none : :new_episodes)}
43
- opts.merge!(vcr_params) if vcr_params
44
- VCR.turn_on!
45
- VCR.insert_cassette(File.basename(fixture_path, '.*'),
46
- opts
47
- )
48
-
49
- end
50
-
51
- #Stops playing/recording from the last call to vcr_load. Returns the
52
- #result of VCR.eject_cassette.
53
- def vcr_stop
54
- VCR.eject_cassette
55
- VCR.turn_off!
56
- end
57
-
58
- #great for s3 because we don't have to worry about changing
59
- #bucket names, only matches as far as s3.amazonaws.com
60
- def vcr_core_host_matcher
61
- lambda do |request1, request2|
62
- core_host = lambda{|host| host.split(/\./).reverse.slice(0, 3).reverse.join('.')}
63
- core_host.call(URI(request1.uri).host) == core_host.call(URI(request2.uri).host)
64
- end #lambda do...
65
- end
66
-
67
- end #class << self
68
- end #App
69
- end #Typingpool