super_diff 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +65 -26
  3. data/lib/super_diff/active_record/differs/active_record_relation.rb +1 -2
  4. data/lib/super_diff/active_record/differs.rb +1 -1
  5. data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_model.rb +22 -18
  6. data/lib/super_diff/active_record/object_inspection/inspection_tree_builders/active_record_relation.rb +14 -7
  7. data/lib/super_diff/active_record/object_inspection/inspection_tree_builders.rb +2 -2
  8. data/lib/super_diff/active_record/object_inspection.rb +1 -1
  9. data/lib/super_diff/active_record/operation_tree_builders/active_record_model.rb +1 -2
  10. data/lib/super_diff/active_record/operation_tree_builders/active_record_relation.rb +1 -2
  11. data/lib/super_diff/active_record/operation_tree_builders.rb +2 -2
  12. data/lib/super_diff/active_record/operation_tree_flatteners.rb +1 -1
  13. data/lib/super_diff/active_record/operation_trees.rb +1 -1
  14. data/lib/super_diff/active_record.rb +7 -15
  15. data/lib/super_diff/active_support/differs/hash_with_indifferent_access.rb +5 -6
  16. data/lib/super_diff/active_support/differs.rb +1 -1
  17. data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/hash_with_indifferent_access.rb +20 -11
  18. data/lib/super_diff/active_support/object_inspection/inspection_tree_builders/ordered_options.rb +46 -0
  19. data/lib/super_diff/active_support/object_inspection/inspection_tree_builders.rb +5 -1
  20. data/lib/super_diff/active_support/object_inspection.rb +1 -1
  21. data/lib/super_diff/active_support/operation_tree_builders/hash_with_indifferent_access.rb +5 -6
  22. data/lib/super_diff/active_support/operation_tree_builders.rb +1 -1
  23. data/lib/super_diff/active_support/operation_tree_flatteners.rb +1 -1
  24. data/lib/super_diff/active_support/operation_trees.rb +1 -1
  25. data/lib/super_diff/active_support.rb +6 -10
  26. data/lib/super_diff/colorized_document_extensions.rb +2 -4
  27. data/lib/super_diff/configuration.rb +14 -8
  28. data/lib/super_diff/csi/color.rb +4 -4
  29. data/lib/super_diff/csi/colorized_document.rb +12 -16
  30. data/lib/super_diff/csi/document.rb +8 -19
  31. data/lib/super_diff/csi/eight_bit_color.rb +19 -19
  32. data/lib/super_diff/csi/four_bit_color.rb +82 -31
  33. data/lib/super_diff/csi/twenty_four_bit_color.rb +12 -11
  34. data/lib/super_diff/csi/uncolorized_document.rb +2 -6
  35. data/lib/super_diff/csi.rb +10 -14
  36. data/lib/super_diff/diff_formatters/collection.rb +35 -41
  37. data/lib/super_diff/differs/date_like.rb +15 -0
  38. data/lib/super_diff/differs/default_object.rb +1 -1
  39. data/lib/super_diff/differs/defaults.rb +2 -1
  40. data/lib/super_diff/differs/main.rb +2 -13
  41. data/lib/super_diff/differs.rb +1 -0
  42. data/lib/super_diff/equality_matchers/array.rb +10 -12
  43. data/lib/super_diff/equality_matchers/base.rb +1 -1
  44. data/lib/super_diff/equality_matchers/default.rb +2 -4
  45. data/lib/super_diff/equality_matchers/defaults.rb +1 -1
  46. data/lib/super_diff/equality_matchers/hash.rb +10 -12
  47. data/lib/super_diff/equality_matchers/multiline_string.rb +11 -13
  48. data/lib/super_diff/equality_matchers/primitive.rb +10 -12
  49. data/lib/super_diff/equality_matchers/singleline_string.rb +10 -12
  50. data/lib/super_diff/equality_matchers.rb +1 -1
  51. data/lib/super_diff/errors.rb +2 -6
  52. data/lib/super_diff/gem_version.rb +3 -3
  53. data/lib/super_diff/helpers.rb +10 -10
  54. data/lib/super_diff/implementation_checks.rb +2 -2
  55. data/lib/super_diff/line.rb +3 -3
  56. data/lib/super_diff/object_inspection/inspection_tree.rb +64 -73
  57. data/lib/super_diff/object_inspection/inspection_tree_builders/array.rb +29 -14
  58. data/lib/super_diff/object_inspection/inspection_tree_builders/custom_object.rb +17 -13
  59. data/lib/super_diff/object_inspection/inspection_tree_builders/date_like.rb +51 -0
  60. data/lib/super_diff/object_inspection/inspection_tree_builders/default_object.rb +43 -27
  61. data/lib/super_diff/object_inspection/inspection_tree_builders/defaults.rb +2 -1
  62. data/lib/super_diff/object_inspection/inspection_tree_builders/hash.rb +35 -18
  63. data/lib/super_diff/object_inspection/inspection_tree_builders/primitive.rb +3 -5
  64. data/lib/super_diff/object_inspection/inspection_tree_builders/time_like.rb +30 -36
  65. data/lib/super_diff/object_inspection/inspection_tree_builders.rb +13 -9
  66. data/lib/super_diff/object_inspection/nodes/as_lines_when_rendering_to_lines.rb +11 -22
  67. data/lib/super_diff/object_inspection/nodes/as_prefix_when_rendering_to_lines.rb +1 -5
  68. data/lib/super_diff/object_inspection/nodes/as_prelude_when_rendering_to_lines.rb +1 -5
  69. data/lib/super_diff/object_inspection/nodes/as_single_line.rb +3 -7
  70. data/lib/super_diff/object_inspection/nodes/base.rb +9 -14
  71. data/lib/super_diff/object_inspection/nodes/inspection.rb +26 -34
  72. data/lib/super_diff/object_inspection/nodes/nesting.rb +1 -1
  73. data/lib/super_diff/object_inspection/nodes/only_when.rb +2 -6
  74. data/lib/super_diff/object_inspection/nodes/text.rb +1 -5
  75. data/lib/super_diff/object_inspection/nodes/when_empty.rb +2 -6
  76. data/lib/super_diff/object_inspection/nodes/when_non_empty.rb +2 -6
  77. data/lib/super_diff/object_inspection/nodes/when_rendering_to_lines.rb +1 -1
  78. data/lib/super_diff/object_inspection/nodes/when_rendering_to_string.rb +1 -5
  79. data/lib/super_diff/object_inspection/nodes.rb +7 -7
  80. data/lib/super_diff/object_inspection.rb +3 -3
  81. data/lib/super_diff/operation_tree_builders/array.rb +12 -11
  82. data/lib/super_diff/operation_tree_builders/base.rb +17 -15
  83. data/lib/super_diff/operation_tree_builders/custom_object.rb +8 -6
  84. data/lib/super_diff/operation_tree_builders/date_like.rb +15 -0
  85. data/lib/super_diff/operation_tree_builders/default_object.rb +29 -21
  86. data/lib/super_diff/operation_tree_builders/defaults.rb +1 -1
  87. data/lib/super_diff/operation_tree_builders/hash.rb +23 -24
  88. data/lib/super_diff/operation_tree_builders/main.rb +4 -11
  89. data/lib/super_diff/operation_tree_builders/multiline_string.rb +3 -3
  90. data/lib/super_diff/operation_tree_builders/time_like.rb +1 -11
  91. data/lib/super_diff/operation_tree_builders.rb +2 -1
  92. data/lib/super_diff/operation_tree_flatteners/base.rb +1 -5
  93. data/lib/super_diff/operation_tree_flatteners/collection.rb +13 -16
  94. data/lib/super_diff/operation_tree_flatteners/default_object.rb +1 -2
  95. data/lib/super_diff/operation_tree_flatteners/hash.rb +2 -10
  96. data/lib/super_diff/operation_tree_flatteners/multiline_string.rb +2 -1
  97. data/lib/super_diff/operation_tree_flatteners.rb +3 -3
  98. data/lib/super_diff/operation_trees/base.rb +3 -5
  99. data/lib/super_diff/operation_trees/default_object.rb +1 -3
  100. data/lib/super_diff/operations/binary_operation.rb +2 -2
  101. data/lib/super_diff/operations/unary_operation.rb +1 -1
  102. data/lib/super_diff/rails.rb +2 -1
  103. data/lib/super_diff/recursion_guard.rb +5 -4
  104. data/lib/super_diff/rspec/augmented_matcher.rb +4 -5
  105. data/lib/super_diff/rspec/differ.rb +6 -13
  106. data/lib/super_diff/rspec/differs/collection_containing_exactly.rb +3 -2
  107. data/lib/super_diff/rspec/differs/collection_including.rb +1 -1
  108. data/lib/super_diff/rspec/differs/hash_including.rb +1 -1
  109. data/lib/super_diff/rspec/differs.rb +3 -3
  110. data/lib/super_diff/rspec/matcher_text_builders/base.rb +13 -15
  111. data/lib/super_diff/rspec/matcher_text_builders/be_predicate.rb +5 -7
  112. data/lib/super_diff/rspec/matcher_text_builders/have_predicate.rb +3 -5
  113. data/lib/super_diff/rspec/matcher_text_builders/raise_error.rb +2 -10
  114. data/lib/super_diff/rspec/matcher_text_builders/respond_to.rb +2 -6
  115. data/lib/super_diff/rspec/matcher_text_builders.rb +5 -8
  116. data/lib/super_diff/rspec/matcher_text_template.rb +13 -16
  117. data/lib/super_diff/rspec/monkey_patches.rb +180 -123
  118. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_containing_exactly.rb +14 -7
  119. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/collection_including.rb +21 -13
  120. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/double.rb +35 -36
  121. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/generic_describable_matcher.rb +19 -0
  122. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/hash_including.rb +21 -15
  123. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/instance_of.rb +11 -10
  124. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/kind_of.rb +11 -10
  125. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/object_having_attributes.rb +14 -7
  126. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders/value_within.rb +10 -11
  127. data/lib/super_diff/rspec/object_inspection/inspection_tree_builders.rb +13 -9
  128. data/lib/super_diff/rspec/object_inspection.rb +1 -1
  129. data/lib/super_diff/rspec/operation_tree_builders/collection_containing_exactly.rb +11 -10
  130. data/lib/super_diff/rspec/operation_tree_builders/collection_including.rb +7 -6
  131. data/lib/super_diff/rspec/operation_tree_builders/hash_including.rb +11 -10
  132. data/lib/super_diff/rspec/operation_tree_builders/object_having_attributes.rb +22 -17
  133. data/lib/super_diff/rspec/operation_tree_builders.rb +4 -4
  134. data/lib/super_diff/rspec.rb +17 -18
  135. data/lib/super_diff/tiered_lines_elider.rb +87 -115
  136. data/lib/super_diff/tiered_lines_formatter.rb +5 -9
  137. data/lib/super_diff/version.rb +1 -1
  138. data/lib/super_diff.rb +13 -9
  139. data/spec/examples.txt +541 -483
  140. data/spec/integration/rails/active_record_spec.rb +3 -1
  141. data/spec/integration/rails/engines_spec.rb +25 -0
  142. data/spec/integration/rails/hash_with_indifferent_access_spec.rb +3 -1
  143. data/spec/integration/rspec/be_falsey_matcher_spec.rb +40 -35
  144. data/spec/integration/rspec/be_matcher_spec.rb +360 -320
  145. data/spec/integration/rspec/be_nil_matcher_spec.rb +38 -34
  146. data/spec/integration/rspec/be_predicate_matcher_spec.rb +376 -359
  147. data/spec/integration/rspec/be_truthy_matcher_spec.rb +38 -33
  148. data/spec/integration/rspec/contain_exactly_matcher_spec.rb +257 -254
  149. data/spec/integration/rspec/eq_matcher_spec.rb +695 -585
  150. data/spec/integration/rspec/generic_describable_matchers_spec.rb +177 -0
  151. data/spec/integration/rspec/have_attributes_matcher_spec.rb +312 -304
  152. data/spec/integration/rspec/have_predicate_matcher_spec.rb +291 -297
  153. data/spec/integration/rspec/include_matcher_spec.rb +327 -225
  154. data/spec/integration/rspec/magic_metadata_spec.rb +51 -0
  155. data/spec/integration/rspec/match_array_matcher_spec.rb +294 -291
  156. data/spec/integration/rspec/match_matcher_spec.rb +916 -903
  157. data/spec/integration/rspec/raise_error_matcher_spec.rb +1208 -449
  158. data/spec/integration/rspec/respond_to_matcher_spec.rb +702 -697
  159. data/spec/integration/rspec/third_party_matcher_spec.rb +142 -138
  160. data/spec/integration/rspec/unhandled_errors_spec.rb +88 -84
  161. data/spec/internal/log/test.log +0 -0
  162. data/spec/spec_helper.rb +20 -20
  163. data/spec/support/command_runner.rb +34 -57
  164. data/spec/support/integration/helpers.rb +44 -32
  165. data/spec/support/integration/matchers/produce_output_when_run_matcher.rb +28 -23
  166. data/spec/support/integration/matchers.rb +34 -0
  167. data/spec/support/integration/test_programs/base.rb +17 -22
  168. data/spec/support/integration/test_programs/plain.rb +6 -0
  169. data/spec/support/integration/test_programs/rspec_active_record.rb +4 -1
  170. data/spec/support/integration/test_programs/rspec_active_support.rb +4 -1
  171. data/spec/support/integration/test_programs/rspec_rails.rb +4 -1
  172. data/spec/support/integration/test_programs/rspec_rails_engine.rb +20 -0
  173. data/spec/support/models/active_record/person.rb +6 -4
  174. data/spec/support/models/active_record/shipping_address.rb +9 -10
  175. data/spec/support/models/customer.rb +2 -4
  176. data/spec/support/models/player.rb +3 -6
  177. data/spec/support/models/shipping_address.rb +4 -13
  178. data/spec/support/shared_examples/active_record.rb +258 -240
  179. data/spec/support/shared_examples/active_support.rb +174 -51
  180. data/spec/support/shared_examples/elided_diffs.rb +447 -423
  181. data/spec/support/shared_examples/hash_with_indifferent_access.rb +500 -464
  182. data/spec/support/shared_examples/key.rb +123 -0
  183. data/spec/support/unit/helpers.rb +1 -3
  184. data/spec/support/unit/matchers/match_output.rb +12 -13
  185. data/spec/unit/active_record/object_inspection_spec.rb +222 -206
  186. data/spec/unit/active_support/object_inspection_spec.rb +170 -0
  187. data/spec/unit/equality_matchers/main_spec.rb +1049 -984
  188. data/spec/unit/helpers_spec.rb +14 -21
  189. data/spec/unit/operation_tree_flatteners/array_spec.rb +557 -524
  190. data/spec/unit/operation_tree_flatteners/custom_object_spec.rb +619 -601
  191. data/spec/unit/operation_tree_flatteners/default_object_spec.rb +619 -621
  192. data/spec/unit/operation_tree_flatteners/hash_spec.rb +595 -556
  193. data/spec/unit/operation_tree_flatteners/multiline_string_spec.rb +102 -92
  194. data/spec/unit/rspec/matchers/be_compared_to_spec.rb +3 -3
  195. data/spec/unit/rspec/matchers/be_predicate_spec.rb +3 -3
  196. data/spec/unit/rspec/matchers/contain_exactly_spec.rb +1 -1
  197. data/spec/unit/rspec/matchers/have_attributes_spec.rb +1 -1
  198. data/spec/unit/rspec/matchers/have_predicate_spec.rb +2 -2
  199. data/spec/unit/rspec/matchers/include_spec.rb +2 -2
  200. data/spec/unit/rspec/matchers/match_array_spec.rb +2 -2
  201. data/spec/unit/rspec/matchers/raise_error_spec.rb +43 -11
  202. data/spec/unit/rspec/matchers/respond_to_spec.rb +23 -16
  203. data/spec/unit/rspec/object_inspection/rspec_matcher_spec.rb +91 -0
  204. data/spec/unit/rspec/object_inspection_spec.rb +351 -326
  205. data/spec/unit/super_diff_spec.rb +1594 -1437
  206. data/spec/unit/tiered_lines_elider_spec.rb +3508 -3536
  207. data/spec/unit/tiered_lines_formatter_spec.rb +54 -116
  208. data/super_diff.gemspec +13 -12
  209. metadata +88 -75
  210. data/lib/super_diff/errors/no_diff_formatter_available_error.rb +0 -21
  211. data/lib/super_diff/errors/no_operational_sequencer_available_error.rb +0 -22
  212. data/spec/tmp/warnings_logger/all_warnings.txt +0 -2
@@ -4,14 +4,14 @@ shared_examples_for "a matcher that supports elided diffs" do
4
4
  it "elides the unchanged sections, preserving <maximum> number of lines within all unchanged sections (including the elision marker)" do
5
5
  as_both_colored_and_uncolored do |color_enabled|
6
6
  snippet = <<~TEST.strip
7
- expected = [
7
+ actual = [
8
8
  "Afghanistan",
9
9
  "Aland Islands",
10
10
  "Albania",
11
11
  "Algeria",
12
12
  "American Samoa",
13
13
  "Andorra",
14
- "Angola",
14
+ "Anguilla",
15
15
  "Antarctica",
16
16
  "Antigua And Barbuda",
17
17
  "Argentina",
@@ -19,14 +19,14 @@ shared_examples_for "a matcher that supports elided diffs" do
19
19
  "Aruba",
20
20
  "Australia"
21
21
  ]
22
- actual = [
22
+ expected = [
23
23
  "Afghanistan",
24
24
  "Aland Islands",
25
25
  "Albania",
26
26
  "Algeria",
27
27
  "American Samoa",
28
28
  "Andorra",
29
- "Anguilla",
29
+ "Angola",
30
30
  "Antarctica",
31
31
  "Antigua And Barbuda",
32
32
  "Argentina",
@@ -36,51 +36,55 @@ shared_examples_for "a matcher that supports elided diffs" do
36
36
  ]
37
37
  expect(actual).to #{matcher}(expected)
38
38
  TEST
39
- program = make_plain_test_program(
40
- snippet,
41
- color_enabled: color_enabled,
42
- configuration: {
43
- diff_elision_enabled: true,
44
- diff_elision_maximum: 3,
45
- },
46
- )
39
+ program =
40
+ make_plain_test_program(
41
+ snippet,
42
+ color_enabled: color_enabled,
43
+ super_diff_configuration: {
44
+ diff_elision_enabled: true,
45
+ diff_elision_maximum: 3
46
+ }
47
+ )
47
48
 
48
- expected_output = build_expected_output(
49
- color_enabled: color_enabled,
50
- snippet: %|expect(actual).to #{matcher}(expected)|,
51
- newline_before_expectation: true,
52
- expectation: proc {
53
- line do
54
- plain "Expected "
55
- # rubocop:disable Layout/LineLength
56
- actual %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
57
- # rubocop:enable Layout/LineLength
58
- end
49
+ expected_output =
50
+ build_expected_output(
51
+ color_enabled: color_enabled,
52
+ snippet: %|expect(actual).to #{matcher}(expected)|,
53
+ newline_before_expectation: true,
54
+ expectation:
55
+ proc do
56
+ line do
57
+ plain "Expected "
58
+ # rubocop:disable Layout/LineLength
59
+ actual %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
60
+ # rubocop:enable Layout/LineLength
61
+ end
59
62
 
60
- line do
61
- plain " to eq "
62
- # rubocop:disable Layout/LineLength
63
- expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
64
- # rubocop:enable Layout/LineLength
65
- end
66
- },
67
- diff: proc {
68
- plain_line %| [|
69
- elision_marker_line %| # ...|
70
- plain_line %| "American Samoa",|
71
- plain_line %| "Andorra",|
72
- expected_line %|- "Angola",|
73
- actual_line %|+ "Anguilla",|
74
- plain_line %| "Antarctica",|
75
- plain_line %| "Antigua And Barbuda",|
76
- elision_marker_line %| # ...|
77
- plain_line %| ]|
78
- },
79
- )
63
+ line do
64
+ plain " to eq "
65
+ # rubocop:disable Layout/LineLength
66
+ expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
67
+ # rubocop:enable Layout/LineLength
68
+ end
69
+ end,
70
+ diff:
71
+ proc do
72
+ plain_line " ["
73
+ elision_marker_line " # ..."
74
+ plain_line %| "American Samoa",|
75
+ plain_line %| "Andorra",|
76
+ expected_line %|- "Angola",|
77
+ actual_line %|+ "Anguilla",|
78
+ plain_line %| "Antarctica",|
79
+ plain_line %| "Antigua And Barbuda",|
80
+ elision_marker_line " # ..."
81
+ plain_line " ]"
82
+ end
83
+ )
80
84
 
81
- expect(program).
82
- to produce_output_when_run(expected_output).
83
- in_color(color_enabled)
85
+ expect(program).to produce_output_when_run(expected_output).in_color(
86
+ color_enabled
87
+ )
84
88
  end
85
89
  end
86
90
  end
@@ -89,14 +93,14 @@ shared_examples_for "a matcher that supports elided diffs" do
89
93
  it "does not elide anything" do
90
94
  as_both_colored_and_uncolored do |color_enabled|
91
95
  snippet = <<~TEST.strip
92
- expected = [
96
+ actual = [
93
97
  "Afghanistan",
94
98
  "Aland Islands",
95
99
  "Albania",
96
100
  "Algeria",
97
101
  "American Samoa",
98
102
  "Andorra",
99
- "Angola",
103
+ "Anguilla",
100
104
  "Antarctica",
101
105
  "Antigua And Barbuda",
102
106
  "Argentina",
@@ -104,14 +108,14 @@ shared_examples_for "a matcher that supports elided diffs" do
104
108
  "Aruba",
105
109
  "Australia"
106
110
  ]
107
- actual = [
111
+ expected = [
108
112
  "Afghanistan",
109
113
  "Aland Islands",
110
114
  "Albania",
111
115
  "Algeria",
112
116
  "American Samoa",
113
117
  "Andorra",
114
- "Anguilla",
118
+ "Angola",
115
119
  "Antarctica",
116
120
  "Antigua And Barbuda",
117
121
  "Argentina",
@@ -121,57 +125,61 @@ shared_examples_for "a matcher that supports elided diffs" do
121
125
  ]
122
126
  expect(actual).to #{matcher}(expected)
123
127
  TEST
124
- program = make_plain_test_program(
125
- snippet,
126
- color_enabled: color_enabled,
127
- configuration: {
128
- diff_elision_enabled: false,
129
- diff_elision_maximum: 3,
130
- },
131
- )
128
+ program =
129
+ make_plain_test_program(
130
+ snippet,
131
+ color_enabled: color_enabled,
132
+ super_diff_configuration: {
133
+ diff_elision_enabled: false,
134
+ diff_elision_maximum: 3
135
+ }
136
+ )
132
137
 
133
- expected_output = build_expected_output(
134
- color_enabled: color_enabled,
135
- snippet: %|expect(actual).to #{matcher}(expected)|,
136
- newline_before_expectation: true,
137
- expectation: proc {
138
- line do
139
- plain "Expected "
140
- # rubocop:disable Layout/LineLength
141
- actual %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
142
- # rubocop:enable Layout/LineLength
143
- end
138
+ expected_output =
139
+ build_expected_output(
140
+ color_enabled: color_enabled,
141
+ snippet: %|expect(actual).to #{matcher}(expected)|,
142
+ newline_before_expectation: true,
143
+ expectation:
144
+ proc do
145
+ line do
146
+ plain "Expected "
147
+ # rubocop:disable Layout/LineLength
148
+ actual %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
149
+ # rubocop:enable Layout/LineLength
150
+ end
144
151
 
145
- line do
146
- plain " to eq "
147
- # rubocop:disable Layout/LineLength
148
- expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
149
- # rubocop:enable Layout/LineLength
150
- end
151
- },
152
- diff: proc {
153
- plain_line %| [|
154
- plain_line %| "Afghanistan",|
155
- plain_line %| "Aland Islands",|
156
- plain_line %| "Albania",|
157
- plain_line %| "Algeria",|
158
- plain_line %| "American Samoa",|
159
- plain_line %| "Andorra",|
160
- expected_line %|- "Angola",|
161
- actual_line %|+ "Anguilla",|
162
- plain_line %| "Antarctica",|
163
- plain_line %| "Antigua And Barbuda",|
164
- plain_line %| "Argentina",|
165
- plain_line %| "Armenia",|
166
- plain_line %| "Aruba",|
167
- plain_line %| "Australia"|
168
- plain_line %| ]|
169
- },
170
- )
152
+ line do
153
+ plain " to eq "
154
+ # rubocop:disable Layout/LineLength
155
+ expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
156
+ # rubocop:enable Layout/LineLength
157
+ end
158
+ end,
159
+ diff:
160
+ proc do
161
+ plain_line " ["
162
+ plain_line %| "Afghanistan",|
163
+ plain_line %| "Aland Islands",|
164
+ plain_line %| "Albania",|
165
+ plain_line %| "Algeria",|
166
+ plain_line %| "American Samoa",|
167
+ plain_line %| "Andorra",|
168
+ expected_line %|- "Angola",|
169
+ actual_line %|+ "Anguilla",|
170
+ plain_line %| "Antarctica",|
171
+ plain_line %| "Antigua And Barbuda",|
172
+ plain_line %| "Argentina",|
173
+ plain_line %| "Armenia",|
174
+ plain_line %| "Aruba",|
175
+ plain_line %| "Australia"|
176
+ plain_line " ]"
177
+ end
178
+ )
171
179
 
172
- expect(program).
173
- to produce_output_when_run(expected_output).
174
- in_color(color_enabled)
180
+ expect(program).to produce_output_when_run(expected_output).in_color(
181
+ color_enabled
182
+ )
175
183
  end
176
184
  end
177
185
  end
@@ -182,8 +190,8 @@ shared_examples_for "a matcher that supports elided diffs" do
182
190
  it "elides the unchanged sections, preserving <maximum> number of lines within all unchanged sections (including the elision marker)" do
183
191
  as_both_colored_and_uncolored do |color_enabled|
184
192
  snippet = <<~TEST.strip
185
- expected = [
186
- "Afghanistan",
193
+ actual = [
194
+ "Zambia",
187
195
  "Aland Islands",
188
196
  "Albania",
189
197
  "Algeria",
@@ -196,10 +204,10 @@ shared_examples_for "a matcher that supports elided diffs" do
196
204
  "Argentina",
197
205
  "Armenia",
198
206
  "Aruba",
199
- "Australia"
207
+ "Zimbabwe"
200
208
  ]
201
- actual = [
202
- "Zambia",
209
+ expected = [
210
+ "Afghanistan",
203
211
  "Aland Islands",
204
212
  "Albania",
205
213
  "Algeria",
@@ -212,54 +220,58 @@ shared_examples_for "a matcher that supports elided diffs" do
212
220
  "Argentina",
213
221
  "Armenia",
214
222
  "Aruba",
215
- "Zimbabwe"
223
+ "Australia"
216
224
  ]
217
225
  expect(actual).to #{matcher}(expected)
218
226
  TEST
219
- program = make_plain_test_program(
220
- snippet,
221
- color_enabled: color_enabled,
222
- configuration: {
223
- diff_elision_enabled: true,
224
- diff_elision_maximum: 3,
225
- },
226
- )
227
+ program =
228
+ make_plain_test_program(
229
+ snippet,
230
+ color_enabled: color_enabled,
231
+ super_diff_configuration: {
232
+ diff_elision_enabled: true,
233
+ diff_elision_maximum: 3
234
+ }
235
+ )
227
236
 
228
- expected_output = build_expected_output(
229
- color_enabled: color_enabled,
230
- snippet: %|expect(actual).to #{matcher}(expected)|,
231
- newline_before_expectation: true,
232
- expectation: proc {
233
- line do
234
- plain "Expected "
235
- # rubocop:disable Layout/LineLength
236
- actual %|["Zambia", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Zimbabwe"]|
237
- # rubocop:enable Layout/LineLength
238
- end
237
+ expected_output =
238
+ build_expected_output(
239
+ color_enabled: color_enabled,
240
+ snippet: %|expect(actual).to #{matcher}(expected)|,
241
+ newline_before_expectation: true,
242
+ expectation:
243
+ proc do
244
+ line do
245
+ plain "Expected "
246
+ # rubocop:disable Layout/LineLength
247
+ actual %|["Zambia", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Zimbabwe"]|
248
+ # rubocop:enable Layout/LineLength
249
+ end
239
250
 
240
- line do
241
- plain " to eq "
242
- # rubocop:disable Layout/LineLength
243
- expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
244
- # rubocop:enable Layout/LineLength
245
- end
246
- },
247
- diff: proc {
248
- plain_line %| [|
249
- expected_line %|- "Afghanistan",|
250
- actual_line %|+ "Zambia",|
251
- plain_line %| "Aland Islands",|
252
- elision_marker_line %| # ...|
253
- plain_line %| "Aruba",|
254
- expected_line %|- "Australia"|
255
- actual_line %|+ "Zimbabwe"|
256
- plain_line %| ]|
257
- },
258
- )
251
+ line do
252
+ plain " to eq "
253
+ # rubocop:disable Layout/LineLength
254
+ expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
255
+ # rubocop:enable Layout/LineLength
256
+ end
257
+ end,
258
+ diff:
259
+ proc do
260
+ plain_line " ["
261
+ expected_line %|- "Afghanistan",|
262
+ actual_line %|+ "Zambia",|
263
+ plain_line %| "Aland Islands",|
264
+ elision_marker_line " # ..."
265
+ plain_line %| "Aruba",|
266
+ expected_line %|- "Australia"|
267
+ actual_line %|+ "Zimbabwe"|
268
+ plain_line " ]"
269
+ end
270
+ )
259
271
 
260
- expect(program).
261
- to produce_output_when_run(expected_output).
262
- in_color(color_enabled)
272
+ expect(program).to produce_output_when_run(expected_output).in_color(
273
+ color_enabled
274
+ )
263
275
  end
264
276
  end
265
277
  end
@@ -268,8 +280,8 @@ shared_examples_for "a matcher that supports elided diffs" do
268
280
  it "does not elide anything" do
269
281
  as_both_colored_and_uncolored do |color_enabled|
270
282
  snippet = <<~TEST.strip
271
- expected = [
272
- "Afghanistan",
283
+ actual = [
284
+ "Zambia",
273
285
  "Aland Islands",
274
286
  "Albania",
275
287
  "Algeria",
@@ -282,10 +294,10 @@ shared_examples_for "a matcher that supports elided diffs" do
282
294
  "Argentina",
283
295
  "Armenia",
284
296
  "Aruba",
285
- "Australia"
297
+ "Zimbabwe"
286
298
  ]
287
- actual = [
288
- "Zambia",
299
+ expected = [
300
+ "Afghanistan",
289
301
  "Aland Islands",
290
302
  "Albania",
291
303
  "Algeria",
@@ -298,63 +310,67 @@ shared_examples_for "a matcher that supports elided diffs" do
298
310
  "Argentina",
299
311
  "Armenia",
300
312
  "Aruba",
301
- "Zimbabwe"
313
+ "Australia"
302
314
  ]
303
315
  expect(actual).to #{matcher}(expected)
304
316
  TEST
305
- program = make_plain_test_program(
306
- snippet,
307
- color_enabled: color_enabled,
308
- configuration: {
309
- diff_elision_enabled: false,
310
- diff_elision_maximum: 3,
311
- },
312
- )
317
+ program =
318
+ make_plain_test_program(
319
+ snippet,
320
+ color_enabled: color_enabled,
321
+ super_diff_configuration: {
322
+ diff_elision_enabled: false,
323
+ diff_elision_maximum: 3
324
+ }
325
+ )
313
326
 
314
- expected_output = build_expected_output(
315
- color_enabled: color_enabled,
316
- snippet: %|expect(actual).to #{matcher}(expected)|,
317
- newline_before_expectation: true,
318
- expectation: proc {
319
- line do
320
- plain "Expected "
321
- # rubocop:disable Layout/LineLength
322
- actual %|["Zambia", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Zimbabwe"]|
323
- # rubocop:enable Layout/LineLength
324
- end
327
+ expected_output =
328
+ build_expected_output(
329
+ color_enabled: color_enabled,
330
+ snippet: %|expect(actual).to #{matcher}(expected)|,
331
+ newline_before_expectation: true,
332
+ expectation:
333
+ proc do
334
+ line do
335
+ plain "Expected "
336
+ # rubocop:disable Layout/LineLength
337
+ actual %|["Zambia", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Zimbabwe"]|
338
+ # rubocop:enable Layout/LineLength
339
+ end
325
340
 
326
- line do
327
- plain " to eq "
328
- # rubocop:disable Layout/LineLength
329
- expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
330
- # rubocop:enable Layout/LineLength
331
- end
332
- },
333
- diff: proc {
334
- plain_line %| [|
335
- expected_line %|- "Afghanistan",|
336
- actual_line %|+ "Zambia",|
337
- plain_line %| "Aland Islands",|
338
- plain_line %| "Albania",|
339
- plain_line %| "Algeria",|
340
- plain_line %| "American Samoa",|
341
- plain_line %| "Andorra",|
342
- plain_line %| "Angola",|
343
- plain_line %| "Anguilla",|
344
- plain_line %| "Antarctica",|
345
- plain_line %| "Antigua And Barbuda",|
346
- plain_line %| "Argentina",|
347
- plain_line %| "Armenia",|
348
- plain_line %| "Aruba",|
349
- expected_line %|- "Australia"|
350
- actual_line %|+ "Zimbabwe"|
351
- plain_line %| ]|
352
- },
353
- )
341
+ line do
342
+ plain " to eq "
343
+ # rubocop:disable Layout/LineLength
344
+ expected %|["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia"]|
345
+ # rubocop:enable Layout/LineLength
346
+ end
347
+ end,
348
+ diff:
349
+ proc do
350
+ plain_line " ["
351
+ expected_line %|- "Afghanistan",|
352
+ actual_line %|+ "Zambia",|
353
+ plain_line %| "Aland Islands",|
354
+ plain_line %| "Albania",|
355
+ plain_line %| "Algeria",|
356
+ plain_line %| "American Samoa",|
357
+ plain_line %| "Andorra",|
358
+ plain_line %| "Angola",|
359
+ plain_line %| "Anguilla",|
360
+ plain_line %| "Antarctica",|
361
+ plain_line %| "Antigua And Barbuda",|
362
+ plain_line %| "Argentina",|
363
+ plain_line %| "Armenia",|
364
+ plain_line %| "Aruba",|
365
+ expected_line %|- "Australia"|
366
+ actual_line %|+ "Zimbabwe"|
367
+ plain_line " ]"
368
+ end
369
+ )
354
370
 
355
- expect(program).
356
- to produce_output_when_run(expected_output).
357
- in_color(color_enabled)
371
+ expect(program).to produce_output_when_run(expected_output).in_color(
372
+ color_enabled
373
+ )
358
374
  end
359
375
  end
360
376
  end
@@ -367,7 +383,7 @@ shared_examples_for "a matcher that supports elided diffs" do
367
383
  # totally weird
368
384
  as_both_colored_and_uncolored do |color_enabled|
369
385
  snippet = <<~TEST.strip
370
- expected = [
386
+ actual = [
371
387
  {
372
388
  "user_id": "18949452",
373
389
  "user": {
@@ -375,6 +391,7 @@ shared_examples_for "a matcher that supports elided diffs" do
375
391
  "name": "Financial Times",
376
392
  "screen_name": "FT",
377
393
  "location": "London",
394
+ "url": "http://t.co/dnhLQpd9BY",
378
395
  "entities": {
379
396
  "url": {
380
397
  "urls": [
@@ -393,7 +410,7 @@ shared_examples_for "a matcher that supports elided diffs" do
393
410
  "urls": [
394
411
  {
395
412
  "url": "https://t.co/5BsmLs9y1Z",
396
- "expanded_url": "http://FT.com",
413
+ "display_url": "FT.com",
397
414
  "indices": [
398
415
  65,
399
416
  88
@@ -402,6 +419,7 @@ shared_examples_for "a matcher that supports elided diffs" do
402
419
  ]
403
420
  }
404
421
  },
422
+ "protected": false,
405
423
  "listed_count": 37009,
406
424
  "created_at": "Tue Jan 13 19:28:24 +0000 2009",
407
425
  "favourites_count": 38,
@@ -415,9 +433,7 @@ shared_examples_for "a matcher that supports elided diffs" do
415
433
  "is_translator": false,
416
434
  "is_translation_enabled": false,
417
435
  "profile_background_color": "FFF1E0",
418
- "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
419
- "profile_background_tile": false,
420
- "profile_image_url": "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
436
+ "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
421
437
  "profile_image_url_https": "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
422
438
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/18949452/1581526592",
423
439
  "profile_image_extensions": {
@@ -433,7 +449,6 @@ shared_examples_for "a matcher that supports elided diffs" do
433
449
  "blocked_by": false,
434
450
  "want_retweets": false,
435
451
  "advertiser_account_type": "none",
436
- "advertiser_account_service_levels": [],
437
452
  "profile_interstitial_type": "",
438
453
  "business_profile_state": "none",
439
454
  "translator_type": "none",
@@ -448,7 +463,7 @@ shared_examples_for "a matcher that supports elided diffs" do
448
463
  "token": "117"
449
464
  }
450
465
  ]
451
- actual = [
466
+ expected = [
452
467
  {
453
468
  "user_id": "18949452",
454
469
  "user": {
@@ -456,7 +471,6 @@ shared_examples_for "a matcher that supports elided diffs" do
456
471
  "name": "Financial Times",
457
472
  "screen_name": "FT",
458
473
  "location": "London",
459
- "url": "http://t.co/dnhLQpd9BY",
460
474
  "entities": {
461
475
  "url": {
462
476
  "urls": [
@@ -475,7 +489,7 @@ shared_examples_for "a matcher that supports elided diffs" do
475
489
  "urls": [
476
490
  {
477
491
  "url": "https://t.co/5BsmLs9y1Z",
478
- "display_url": "FT.com",
492
+ "expanded_url": "http://FT.com",
479
493
  "indices": [
480
494
  65,
481
495
  88
@@ -484,7 +498,6 @@ shared_examples_for "a matcher that supports elided diffs" do
484
498
  ]
485
499
  }
486
500
  },
487
- "protected": false,
488
501
  "listed_count": 37009,
489
502
  "created_at": "Tue Jan 13 19:28:24 +0000 2009",
490
503
  "favourites_count": 38,
@@ -498,7 +511,9 @@ shared_examples_for "a matcher that supports elided diffs" do
498
511
  "is_translator": false,
499
512
  "is_translation_enabled": false,
500
513
  "profile_background_color": "FFF1E0",
501
- "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
514
+ "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
515
+ "profile_background_tile": false,
516
+ "profile_image_url": "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
502
517
  "profile_image_url_https": "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
503
518
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/18949452/1581526592",
504
519
  "profile_image_extensions": {
@@ -514,6 +529,7 @@ shared_examples_for "a matcher that supports elided diffs" do
514
529
  "blocked_by": false,
515
530
  "want_retweets": false,
516
531
  "advertiser_account_type": "none",
532
+ "advertiser_account_service_levels": [],
517
533
  "profile_interstitial_type": "",
518
534
  "business_profile_state": "none",
519
535
  "translator_type": "none",
@@ -530,92 +546,96 @@ shared_examples_for "a matcher that supports elided diffs" do
530
546
  ]
531
547
  expect(actual).to #{matcher}(expected)
532
548
  TEST
533
- program = make_plain_test_program(
534
- snippet,
535
- color_enabled: color_enabled,
536
- configuration: {
537
- diff_elision_enabled: true,
538
- diff_elision_maximum: 10,
539
- },
540
- )
549
+ program =
550
+ make_plain_test_program(
551
+ snippet,
552
+ color_enabled: color_enabled,
553
+ super_diff_configuration: {
554
+ diff_elision_enabled: true,
555
+ diff_elision_maximum: 10
556
+ }
557
+ )
541
558
 
542
- expected_output = build_expected_output(
543
- color_enabled: color_enabled,
544
- snippet: %|expect(actual).to #{matcher}(expected)|,
545
- newline_before_expectation: true,
546
- expectation: proc {
547
- line do
548
- plain "Expected "
549
- # rubocop:disable Layout/LineLength
550
- actual %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", url: "http://t.co/dnhLQpd9BY", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", display_url: "FT.com", indices: [65, 88] }] } }, protected: false, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
551
- # rubocop:enable Layout/LineLength
552
- end
559
+ expected_output =
560
+ build_expected_output(
561
+ color_enabled: color_enabled,
562
+ snippet: %|expect(actual).to #{matcher}(expected)|,
563
+ newline_before_expectation: true,
564
+ expectation:
565
+ proc do
566
+ line do
567
+ plain "Expected "
568
+ # rubocop:disable Layout/LineLength
569
+ actual %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", url: "http://t.co/dnhLQpd9BY", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", display_url: "FT.com", indices: [65, 88] }] } }, protected: false, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
570
+ # rubocop:enable Layout/LineLength
571
+ end
553
572
 
554
- line do
555
- plain " to eq "
556
- # rubocop:disable Layout/LineLength
557
- expected %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", expanded_url: "http://FT.com", indices: [65, 88] }] } }, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", advertiser_account_service_levels: [], profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
558
- # rubocop:enable Layout/LineLength
559
- end
560
- },
561
- diff: proc {
562
- plain_line %| [|
563
- plain_line %| {|
564
- plain_line %| user_id: "18949452",|
565
- plain_line %| user: {|
566
- plain_line %| id: 18949452,|
567
- plain_line %| name: "Financial Times",|
568
- plain_line %| screen_name: "FT",|
569
- plain_line %| location: "London",|
570
- actual_line %|+ url: "http://t.co/dnhLQpd9BY",|
571
- plain_line %| entities: {|
572
- plain_line %| url: {|
573
- plain_line %| urls: [|
574
- elision_marker_line %| # ...|
575
- plain_line %| ]|
576
- plain_line %| },|
577
- plain_line %| description: {|
578
- plain_line %| urls: [|
579
- plain_line %| {|
580
- elision_marker_line %| # ...|
581
- expected_line %|- expanded_url: "http://FT.com",|
582
- actual_line %|+ display_url: "FT.com",|
583
- plain_line %| indices: [|
584
- plain_line %| 65,|
585
- plain_line %| 88|
586
- plain_line %| ]|
587
- plain_line %| }|
588
- plain_line %| ]|
589
- plain_line %| }|
590
- plain_line %| },|
591
- actual_line %|+ protected: false,|
592
- elision_marker_line %| # ...|
593
- expected_line %|- profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",|
594
- expected_line %|- profile_background_tile: false,|
595
- expected_line %|- profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
596
- actual_line %|+ profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png",|
597
- plain_line %| profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
598
- plain_line %| profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",|
599
- plain_line %| profile_image_extensions: {|
600
- elision_marker_line %| # ...|
601
- plain_line %| },|
602
- plain_line %| profile_banner_extensions: {},|
603
- plain_line %| blocking: false,|
604
- plain_line %| blocked_by: false,|
605
- plain_line %| want_retweets: false,|
606
- plain_line %| advertiser_account_type: "none",|
607
- expected_line %|- advertiser_account_service_levels: [],|
608
- elision_marker_line %| # ...|
609
- plain_line %| },|
610
- plain_line %| token: "117"|
611
- plain_line %| }|
612
- plain_line %| ]|
613
- },
614
- )
573
+ line do
574
+ plain " to eq "
575
+ # rubocop:disable Layout/LineLength
576
+ expected %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", expanded_url: "http://FT.com", indices: [65, 88] }] } }, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", advertiser_account_service_levels: [], profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
577
+ # rubocop:enable Layout/LineLength
578
+ end
579
+ end,
580
+ diff:
581
+ proc do
582
+ plain_line " ["
583
+ plain_line " {"
584
+ plain_line %| user_id: "18949452",|
585
+ plain_line " user: {"
586
+ plain_line " id: 18949452,"
587
+ plain_line %| name: "Financial Times",|
588
+ plain_line %| screen_name: "FT",|
589
+ plain_line %| location: "London",|
590
+ actual_line %|+ url: "http://t.co/dnhLQpd9BY",|
591
+ plain_line " entities: {"
592
+ plain_line " url: {"
593
+ plain_line " urls: ["
594
+ elision_marker_line " # ..."
595
+ plain_line " ]"
596
+ plain_line " },"
597
+ plain_line " description: {"
598
+ plain_line " urls: ["
599
+ plain_line " {"
600
+ elision_marker_line " # ..."
601
+ expected_line %|- expanded_url: "http://FT.com",|
602
+ actual_line %|+ display_url: "FT.com",|
603
+ plain_line " indices: ["
604
+ plain_line " 65,"
605
+ plain_line " 88"
606
+ plain_line " ]"
607
+ plain_line " }"
608
+ plain_line " ]"
609
+ plain_line " }"
610
+ plain_line " },"
611
+ actual_line "+ protected: false,"
612
+ elision_marker_line " # ..."
613
+ expected_line %|- profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",|
614
+ expected_line "- profile_background_tile: false,"
615
+ expected_line %|- profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
616
+ actual_line %|+ profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png",|
617
+ plain_line %| profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
618
+ plain_line %| profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",|
619
+ plain_line " profile_image_extensions: {"
620
+ elision_marker_line " # ..."
621
+ plain_line " },"
622
+ plain_line " profile_banner_extensions: {},"
623
+ plain_line " blocking: false,"
624
+ plain_line " blocked_by: false,"
625
+ plain_line " want_retweets: false,"
626
+ plain_line %| advertiser_account_type: "none",|
627
+ expected_line "- advertiser_account_service_levels: [],"
628
+ elision_marker_line " # ..."
629
+ plain_line " },"
630
+ plain_line %| token: "117"|
631
+ plain_line " }"
632
+ plain_line " ]"
633
+ end
634
+ )
615
635
 
616
- expect(program).
617
- to produce_output_when_run(expected_output).
618
- in_color(color_enabled)
636
+ expect(program).to produce_output_when_run(expected_output).in_color(
637
+ color_enabled
638
+ )
619
639
  end
620
640
  end
621
641
  end
@@ -624,7 +644,7 @@ shared_examples_for "a matcher that supports elided diffs" do
624
644
  it "does not elide anything" do
625
645
  as_both_colored_and_uncolored do |color_enabled|
626
646
  snippet = <<~TEST.strip
627
- expected = [
647
+ actual = [
628
648
  {
629
649
  "user_id": "18949452",
630
650
  "user": {
@@ -632,6 +652,7 @@ shared_examples_for "a matcher that supports elided diffs" do
632
652
  "name": "Financial Times",
633
653
  "screen_name": "FT",
634
654
  "location": "London",
655
+ "url": "http://t.co/dnhLQpd9BY",
635
656
  "entities": {
636
657
  "url": {
637
658
  "urls": [
@@ -650,7 +671,7 @@ shared_examples_for "a matcher that supports elided diffs" do
650
671
  "urls": [
651
672
  {
652
673
  "url": "https://t.co/5BsmLs9y1Z",
653
- "expanded_url": "http://FT.com",
674
+ "display_url": "FT.com",
654
675
  "indices": [
655
676
  65,
656
677
  88
@@ -659,6 +680,7 @@ shared_examples_for "a matcher that supports elided diffs" do
659
680
  ]
660
681
  }
661
682
  },
683
+ "protected": false,
662
684
  "listed_count": 37009,
663
685
  "created_at": "Tue Jan 13 19:28:24 +0000 2009",
664
686
  "favourites_count": 38,
@@ -672,9 +694,7 @@ shared_examples_for "a matcher that supports elided diffs" do
672
694
  "is_translator": false,
673
695
  "is_translation_enabled": false,
674
696
  "profile_background_color": "FFF1E0",
675
- "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
676
- "profile_background_tile": false,
677
- "profile_image_url": "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
697
+ "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
678
698
  "profile_image_url_https": "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
679
699
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/18949452/1581526592",
680
700
  "profile_image_extensions": {
@@ -690,7 +710,6 @@ shared_examples_for "a matcher that supports elided diffs" do
690
710
  "blocked_by": false,
691
711
  "want_retweets": false,
692
712
  "advertiser_account_type": "none",
693
- "advertiser_account_service_levels": [],
694
713
  "profile_interstitial_type": "",
695
714
  "business_profile_state": "none",
696
715
  "translator_type": "none",
@@ -705,7 +724,7 @@ shared_examples_for "a matcher that supports elided diffs" do
705
724
  "token": "117"
706
725
  }
707
726
  ]
708
- actual = [
727
+ expected = [
709
728
  {
710
729
  "user_id": "18949452",
711
730
  "user": {
@@ -713,7 +732,6 @@ shared_examples_for "a matcher that supports elided diffs" do
713
732
  "name": "Financial Times",
714
733
  "screen_name": "FT",
715
734
  "location": "London",
716
- "url": "http://t.co/dnhLQpd9BY",
717
735
  "entities": {
718
736
  "url": {
719
737
  "urls": [
@@ -732,7 +750,7 @@ shared_examples_for "a matcher that supports elided diffs" do
732
750
  "urls": [
733
751
  {
734
752
  "url": "https://t.co/5BsmLs9y1Z",
735
- "display_url": "FT.com",
753
+ "expanded_url": "http://FT.com",
736
754
  "indices": [
737
755
  65,
738
756
  88
@@ -741,7 +759,6 @@ shared_examples_for "a matcher that supports elided diffs" do
741
759
  ]
742
760
  }
743
761
  },
744
- "protected": false,
745
762
  "listed_count": 37009,
746
763
  "created_at": "Tue Jan 13 19:28:24 +0000 2009",
747
764
  "favourites_count": 38,
@@ -755,7 +772,9 @@ shared_examples_for "a matcher that supports elided diffs" do
755
772
  "is_translator": false,
756
773
  "is_translation_enabled": false,
757
774
  "profile_background_color": "FFF1E0",
758
- "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
775
+ "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
776
+ "profile_background_tile": false,
777
+ "profile_image_url": "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
759
778
  "profile_image_url_https": "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",
760
779
  "profile_banner_url": "https://pbs.twimg.com/profile_banners/18949452/1581526592",
761
780
  "profile_image_extensions": {
@@ -771,6 +790,7 @@ shared_examples_for "a matcher that supports elided diffs" do
771
790
  "blocked_by": false,
772
791
  "want_retweets": false,
773
792
  "advertiser_account_type": "none",
793
+ "advertiser_account_service_levels": [],
774
794
  "profile_interstitial_type": "",
775
795
  "business_profile_state": "none",
776
796
  "translator_type": "none",
@@ -787,126 +807,130 @@ shared_examples_for "a matcher that supports elided diffs" do
787
807
  ]
788
808
  expect(actual).to #{matcher}(expected)
789
809
  TEST
790
- program = make_plain_test_program(
791
- snippet,
792
- color_enabled: color_enabled,
793
- configuration: {
794
- diff_elision_enabled: false,
795
- diff_elision_maximum: 10,
796
- },
797
- )
810
+ program =
811
+ make_plain_test_program(
812
+ snippet,
813
+ color_enabled: color_enabled,
814
+ super_diff_configuration: {
815
+ diff_elision_enabled: false,
816
+ diff_elision_maximum: 10
817
+ }
818
+ )
798
819
 
799
- expected_output = build_expected_output(
800
- color_enabled: color_enabled,
801
- snippet: %|expect(actual).to #{matcher}(expected)|,
802
- newline_before_expectation: true,
803
- expectation: proc {
804
- line do
805
- plain "Expected "
806
- # rubocop:disable Layout/LineLength
807
- actual %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", url: "http://t.co/dnhLQpd9BY", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", display_url: "FT.com", indices: [65, 88] }] } }, protected: false, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
808
- # rubocop:enable Layout/LineLength
809
- end
820
+ expected_output =
821
+ build_expected_output(
822
+ color_enabled: color_enabled,
823
+ snippet: %|expect(actual).to #{matcher}(expected)|,
824
+ newline_before_expectation: true,
825
+ expectation:
826
+ proc do
827
+ line do
828
+ plain "Expected "
829
+ # rubocop:disable Layout/LineLength
830
+ actual %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", url: "http://t.co/dnhLQpd9BY", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", display_url: "FT.com", indices: [65, 88] }] } }, protected: false, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
831
+ # rubocop:enable Layout/LineLength
832
+ end
810
833
 
811
- line do
812
- plain " to eq "
813
- # rubocop:disable Layout/LineLength
814
- expected %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", expanded_url: "http://FT.com", indices: [65, 88] }] } }, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", advertiser_account_service_levels: [], profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
815
- # rubocop:enable Layout/LineLength
816
- end
817
- },
818
- diff: proc {
819
- plain_line %| [|
820
- plain_line %| {|
821
- plain_line %| user_id: "18949452",|
822
- plain_line %| user: {|
823
- plain_line %| id: 18949452,|
824
- plain_line %| name: "Financial Times",|
825
- plain_line %| screen_name: "FT",|
826
- plain_line %| location: "London",|
827
- actual_line %|+ url: "http://t.co/dnhLQpd9BY",|
828
- plain_line %| entities: {|
829
- plain_line %| url: {|
830
- plain_line %| urls: [|
831
- plain_line %| {|
832
- plain_line %| url: "http://t.co/dnhLQpd9BY",|
833
- plain_line %| expanded_url: "http://www.ft.com/",|
834
- plain_line %| display_url: "ft.com",|
835
- plain_line %| indices: [|
836
- plain_line %| 0,|
837
- plain_line %| 22|
838
- plain_line %| ]|
839
- plain_line %| }|
840
- plain_line %| ]|
841
- plain_line %| },|
842
- plain_line %| description: {|
843
- plain_line %| urls: [|
844
- plain_line %| {|
845
- plain_line %| url: "https://t.co/5BsmLs9y1Z",|
846
- expected_line %|- expanded_url: "http://FT.com",|
847
- actual_line %|+ display_url: "FT.com",|
848
- plain_line %| indices: [|
849
- plain_line %| 65,|
850
- plain_line %| 88|
851
- plain_line %| ]|
852
- plain_line %| }|
853
- plain_line %| ]|
854
- plain_line %| }|
855
- plain_line %| },|
856
- actual_line %|+ protected: false,|
857
- plain_line %| listed_count: 37009,|
858
- plain_line %| created_at: "Tue Jan 13 19:28:24 +0000 2009",|
859
- plain_line %| favourites_count: 38,|
860
- plain_line %| utc_offset: nil,|
861
- plain_line %| time_zone: nil,|
862
- plain_line %| geo_enabled: false,|
863
- plain_line %| verified: true,|
864
- plain_line %| statuses_count: 273860,|
865
- plain_line %| media_count: 51044,|
866
- plain_line %| contributors_enabled: false,|
867
- plain_line %| is_translator: false,|
868
- plain_line %| is_translation_enabled: false,|
869
- plain_line %| profile_background_color: "FFF1E0",|
870
- expected_line %|- profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",|
871
- expected_line %|- profile_background_tile: false,|
872
- expected_line %|- profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
873
- actual_line %|+ profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png",|
874
- plain_line %| profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
875
- plain_line %| profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",|
876
- plain_line %| profile_image_extensions: {|
877
- plain_line %| mediaStats: {|
878
- plain_line %| r: {|
879
- plain_line %| missing: nil|
880
- plain_line %| },|
881
- plain_line %| ttl: -1|
882
- plain_line %| }|
883
- plain_line %| },|
884
- plain_line %| profile_banner_extensions: {},|
885
- plain_line %| blocking: false,|
886
- plain_line %| blocked_by: false,|
887
- plain_line %| want_retweets: false,|
888
- plain_line %| advertiser_account_type: "none",|
889
- expected_line %|- advertiser_account_service_levels: [],|
890
- plain_line %| profile_interstitial_type: "",|
891
- plain_line %| business_profile_state: "none",|
892
- plain_line %| translator_type: "none",|
893
- plain_line %| followed_by: false,|
894
- plain_line %| ext: {|
895
- plain_line %| highlightedLabel: {|
896
- plain_line %| ttl: -1|
897
- plain_line %| }|
898
- plain_line %| },|
899
- plain_line %| require_some_consent: false|
900
- plain_line %| },|
901
- plain_line %| token: "117"|
902
- plain_line %| }|
903
- plain_line %| ]|
904
- },
905
- )
834
+ line do
835
+ plain " to eq "
836
+ # rubocop:disable Layout/LineLength
837
+ expected %<[{ user_id: "18949452", user: { id: 18949452, name: "Financial Times", screen_name: "FT", location: "London", entities: { url: { urls: [{ url: "http://t.co/dnhLQpd9BY", expanded_url: "http://www.ft.com/", display_url: "ft.com", indices: [0, 22] }] }, description: { urls: [{ url: "https://t.co/5BsmLs9y1Z", expanded_url: "http://FT.com", indices: [65, 88] }] } }, listed_count: 37009, created_at: "Tue Jan 13 19:28:24 +0000 2009", favourites_count: 38, utc_offset: nil, time_zone: nil, geo_enabled: false, verified: true, statuses_count: 273860, media_count: 51044, contributors_enabled: false, is_translator: false, is_translation_enabled: false, profile_background_color: "FFF1E0", profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png", profile_background_tile: false, profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg", profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592", profile_image_extensions: { mediaStats: { r: { missing: nil }, ttl: -1 } }, profile_banner_extensions: {}, blocking: false, blocked_by: false, want_retweets: false, advertiser_account_type: "none", advertiser_account_service_levels: [], profile_interstitial_type: "", business_profile_state: "none", translator_type: "none", followed_by: false, ext: { highlightedLabel: { ttl: -1 } }, require_some_consent: false }, token: "117" }]>
838
+ # rubocop:enable Layout/LineLength
839
+ end
840
+ end,
841
+ diff:
842
+ proc do
843
+ plain_line " ["
844
+ plain_line " {"
845
+ plain_line %| user_id: "18949452",|
846
+ plain_line " user: {"
847
+ plain_line " id: 18949452,"
848
+ plain_line %| name: "Financial Times",|
849
+ plain_line %| screen_name: "FT",|
850
+ plain_line %| location: "London",|
851
+ actual_line %|+ url: "http://t.co/dnhLQpd9BY",|
852
+ plain_line " entities: {"
853
+ plain_line " url: {"
854
+ plain_line " urls: ["
855
+ plain_line " {"
856
+ plain_line %| url: "http://t.co/dnhLQpd9BY",|
857
+ plain_line %| expanded_url: "http://www.ft.com/",|
858
+ plain_line %| display_url: "ft.com",|
859
+ plain_line " indices: ["
860
+ plain_line " 0,"
861
+ plain_line " 22"
862
+ plain_line " ]"
863
+ plain_line " }"
864
+ plain_line " ]"
865
+ plain_line " },"
866
+ plain_line " description: {"
867
+ plain_line " urls: ["
868
+ plain_line " {"
869
+ plain_line %| url: "https://t.co/5BsmLs9y1Z",|
870
+ expected_line %|- expanded_url: "http://FT.com",|
871
+ actual_line %|+ display_url: "FT.com",|
872
+ plain_line " indices: ["
873
+ plain_line " 65,"
874
+ plain_line " 88"
875
+ plain_line " ]"
876
+ plain_line " }"
877
+ plain_line " ]"
878
+ plain_line " }"
879
+ plain_line " },"
880
+ actual_line "+ protected: false,"
881
+ plain_line " listed_count: 37009,"
882
+ plain_line %| created_at: "Tue Jan 13 19:28:24 +0000 2009",|
883
+ plain_line " favourites_count: 38,"
884
+ plain_line " utc_offset: nil,"
885
+ plain_line " time_zone: nil,"
886
+ plain_line " geo_enabled: false,"
887
+ plain_line " verified: true,"
888
+ plain_line " statuses_count: 273860,"
889
+ plain_line " media_count: 51044,"
890
+ plain_line " contributors_enabled: false,"
891
+ plain_line " is_translator: false,"
892
+ plain_line " is_translation_enabled: false,"
893
+ plain_line %| profile_background_color: "FFF1E0",|
894
+ expected_line %|- profile_background_image_url_https: "https://abs.twimg.com/images/themes/theme1/bg.png",|
895
+ expected_line "- profile_background_tile: false,"
896
+ expected_line %|- profile_image_url: "http://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
897
+ actual_line %|+ profile_background_image_url: "http://abs.twimg.com/images/themes/theme1/bg.png",|
898
+ plain_line %| profile_image_url_https: "https://pbs.twimg.com/profile_images/931156393108885504/EqEMtLhM_normal.jpg",|
899
+ plain_line %| profile_banner_url: "https://pbs.twimg.com/profile_banners/18949452/1581526592",|
900
+ plain_line " profile_image_extensions: {"
901
+ plain_line " mediaStats: {"
902
+ plain_line " r: {"
903
+ plain_line " missing: nil"
904
+ plain_line " },"
905
+ plain_line " ttl: -1"
906
+ plain_line " }"
907
+ plain_line " },"
908
+ plain_line " profile_banner_extensions: {},"
909
+ plain_line " blocking: false,"
910
+ plain_line " blocked_by: false,"
911
+ plain_line " want_retweets: false,"
912
+ plain_line %| advertiser_account_type: "none",|
913
+ expected_line "- advertiser_account_service_levels: [],"
914
+ plain_line %| profile_interstitial_type: "",|
915
+ plain_line %| business_profile_state: "none",|
916
+ plain_line %| translator_type: "none",|
917
+ plain_line " followed_by: false,"
918
+ plain_line " ext: {"
919
+ plain_line " highlightedLabel: {"
920
+ plain_line " ttl: -1"
921
+ plain_line " }"
922
+ plain_line " },"
923
+ plain_line " require_some_consent: false"
924
+ plain_line " },"
925
+ plain_line %| token: "117"|
926
+ plain_line " }"
927
+ plain_line " ]"
928
+ end
929
+ )
906
930
 
907
- expect(program).
908
- to produce_output_when_run(expected_output).
909
- in_color(color_enabled)
931
+ expect(program).to produce_output_when_run(expected_output).in_color(
932
+ color_enabled
933
+ )
910
934
  end
911
935
  end
912
936
  end