gergich 0.2.2 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +2 -2
  3. data/README.md +0 -1
  4. data/bin/check_coverage +2 -1
  5. data/bin/gergich +1 -0
  6. data/bin/master_bouncer +1 -1
  7. data/bin/run_tests.sh +8 -43
  8. data/lib/gergich.rb +20 -24
  9. data/lib/gergich/capture.rb +8 -4
  10. data/lib/gergich/capture/androidlint_capture.rb +5 -1
  11. data/lib/gergich/capture/brakeman_capture.rb +4 -2
  12. data/lib/gergich/capture/eslint_capture.rb +2 -0
  13. data/lib/gergich/capture/flake8_capture.rb +2 -0
  14. data/lib/gergich/capture/i18nliner_capture.rb +2 -0
  15. data/lib/gergich/capture/rubocop_capture.rb +2 -0
  16. data/lib/gergich/capture/shellcheck_capture.rb +2 -0
  17. data/lib/gergich/capture/stylelint_capture.rb +8 -5
  18. data/lib/gergich/capture/swiftlint_capture.rb +5 -1
  19. data/lib/gergich/cli.rb +4 -2
  20. data/lib/gergich/cli/gergich.rb +119 -118
  21. data/lib/gergich/cli/master_bouncer.rb +16 -14
  22. data/spec/gergich/capture/androidlint_capture_spec.rb +15 -10
  23. data/spec/gergich/capture/brakeman_capture_spec.rb +43 -41
  24. data/spec/gergich/capture/custom_capture_spec.rb +4 -2
  25. data/spec/gergich/capture/eslint_capture_spec.rb +6 -4
  26. data/spec/gergich/capture/flake8_capture_spec.rb +4 -2
  27. data/spec/gergich/capture/i18nliner_capture_spec.rb +6 -4
  28. data/spec/gergich/capture/rubocop_capture_spec.rb +24 -22
  29. data/spec/gergich/capture/shellcheck_capture_spec.rb +45 -43
  30. data/spec/gergich/capture/stylelint_capture_spec.rb +16 -7
  31. data/spec/gergich/capture/swiftlint_capture_spec.rb +8 -5
  32. data/spec/gergich/capture_spec.rb +6 -4
  33. data/spec/gergich_spec.rb +58 -4
  34. data/spec/spec_helper.rb +2 -0
  35. data/spec/support/capture_shared_examples.rb +2 -0
  36. metadata +39 -40
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::BrakemanCapture do
@@ -10,75 +12,75 @@ RSpec.describe Gergich::Capture::BrakemanCapture do
10
12
  let(:comments) do
11
13
  [
12
14
  {
13
- path: "app/models/custom_data.rb",
15
+ path: "app/models/custom_data.rb",
14
16
  position: 36,
15
- message: <<-MESSAGE.strip,
16
- [brakeman] Attribute Restriction: attr_accessible is recommended over attr_protected
17
- See: http://brakemanscanner.org/docs/warning_types/attribute_restriction/
18
- MESSAGE
17
+ message: <<~MESSAGE.strip,
18
+ [brakeman] Attribute Restriction: attr_accessible is recommended over attr_protected
19
+ See: http://brakemanscanner.org/docs/warning_types/attribute_restriction/
20
+ MESSAGE
19
21
  severity: "warn"
20
22
  },
21
23
  {
22
- path: "app/models/submission_comment.rb",
24
+ path: "app/models/submission_comment.rb",
23
25
  position: 0,
24
- message: <<-MESSAGE.strip,
25
- [brakeman] Mass Assignment: Potentially dangerous attribute available for mass assignment
26
- Code: :context_id
27
- See: http://brakemanscanner.org/docs/warning_types/mass_assignment/
28
- MESSAGE
26
+ message: <<~MESSAGE.strip,
27
+ [brakeman] Mass Assignment: Potentially dangerous attribute available for mass assignment
28
+ Code: :context_id
29
+ See: http://brakemanscanner.org/docs/warning_types/mass_assignment/
30
+ MESSAGE
29
31
  severity: "warn"
30
32
  },
31
33
  {
32
- path: "app/controllers/context_controller.rb",
34
+ path: "app/controllers/context_controller.rb",
33
35
  position: 60,
34
- message: <<-MESSAGE.strip,
35
- [brakeman] Redirect: Possible unprotected redirect
36
- Code: redirect_to(CanvasKaltura::ClientV3.new.assetSwfUrl(params[:id]))
37
- User Input: params[:id]
38
- See: http://brakemanscanner.org/docs/warning_types/redirect/
39
- MESSAGE
36
+ message: <<~MESSAGE.strip,
37
+ [brakeman] Redirect: Possible unprotected redirect
38
+ Code: redirect_to(CanvasKaltura::ClientV3.new.assetSwfUrl(params[:id]))
39
+ User Input: params[:id]
40
+ See: http://brakemanscanner.org/docs/warning_types/redirect/
41
+ MESSAGE
40
42
  severity: "warn"
41
43
  },
42
44
  {
43
- path: "app/views/context/object_snippet.html.erb",
45
+ path: "app/views/context/object_snippet.html.erb",
44
46
  position: 6,
45
- message: <<-MESSAGE.strip,
46
- [brakeman] Cross Site Scripting: Unescaped parameter value
47
- Code: Base64.decode64((params[:object_data] or ""))
48
- User Input: params[:object_data]
49
- See: http://brakemanscanner.org/docs/warning_types/cross_site_scripting
47
+ message: <<~MESSAGE.strip,
48
+ [brakeman] Cross Site Scripting: Unescaped parameter value
49
+ Code: Base64.decode64((params[:object_data] or ""))
50
+ User Input: params[:object_data]
51
+ See: http://brakemanscanner.org/docs/warning_types/cross_site_scripting
50
52
  MESSAGE
51
53
  severity: "warn"
52
54
  },
53
55
  {
54
- path: "app/models/account.rb",
56
+ path: "app/models/account.rb",
55
57
  position: 795,
56
- message: <<-MESSAGE.strip,
57
- [brakeman] SQL Injection: Possible SQL injection
58
- Code: Account.find_by_sql(Account.sub_account_ids_recursive_sql(parent_account_id))
59
- User Input: Account.sub_account_ids_recursive_sql(parent_account_id)
60
- See: http://brakemanscanner.org/docs/warning_types/sql_injection/
58
+ message: <<~MESSAGE.strip,
59
+ [brakeman] SQL Injection: Possible SQL injection
60
+ Code: Account.find_by_sql(Account.sub_account_ids_recursive_sql(parent_account_id))
61
+ User Input: Account.sub_account_ids_recursive_sql(parent_account_id)
62
+ See: http://brakemanscanner.org/docs/warning_types/sql_injection/
61
63
  MESSAGE
62
64
  severity: "error"
63
65
  },
64
66
  {
65
- path: "lib/cc/importer/blti_converter.rb",
67
+ path: "lib/cc/importer/blti_converter.rb",
66
68
  position: 145,
67
- message: <<-MESSAGE.strip,
68
- [brakeman] SSL Verification Bypass: SSL certificate verification was bypassed
69
- Code: Net::HTTP.new(URI.parse(url).host, URI.parse(url).port).verify_mode = OpenSSL::SSL::VERIFY_NONE
70
- See: http://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/
69
+ message: <<~MESSAGE.strip,
70
+ [brakeman] SSL Verification Bypass: SSL certificate verification was bypassed
71
+ Code: Net::HTTP.new(URI.parse(url).host, URI.parse(url).port).verify_mode = OpenSSL::SSL::VERIFY_NONE
72
+ See: http://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/
71
73
  MESSAGE
72
74
  severity: "error"
73
75
  },
74
76
  {
75
- path: "lib/cc/importer/canvas/quiz_converter.rb",
77
+ path: "lib/cc/importer/canvas/quiz_converter.rb",
76
78
  position: 44,
77
- message: <<-MESSAGE.strip,
78
- [brakeman] Command Injection: Possible command injection
79
- Code: `\#{Qti.get_conversion_command(File.join(qti_folder, "qti_2_1"), qti_folder)}`
80
- User Input: Qti.get_conversion_command(File.join(qti_folder, "qti_2_1"), qti_folder)
81
- See: http://brakemanscanner.org/docs/warning_types/command_injection/
79
+ message: <<~MESSAGE.strip,
80
+ [brakeman] Command Injection: Possible command injection
81
+ Code: `\#{Qti.get_conversion_command(File.join(qti_folder, "qti_2_1"), qti_folder)}`
82
+ User Input: Qti.get_conversion_command(File.join(qti_folder, "qti_2_1"), qti_folder)
83
+ See: http://brakemanscanner.org/docs/warning_types/command_injection/
82
84
  MESSAGE
83
85
  severity: "warn"
84
86
  }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../../lib/gergich/capture"
2
4
 
3
5
  RSpec.describe "CustomCaptor" do
@@ -12,8 +14,8 @@ RSpec.describe "CustomCaptor" do
12
14
  let(:described_class) { CustomCaptor }
13
15
  let(:capture_format) { "custom:sqlite3:CustomCaptor" }
14
16
  let(:output) do
15
- <<-OUTPUT
16
- foo.rb:1: you done screwed up
17
+ <<~OUTPUT
18
+ foo.rb:1: you done screwed up
17
19
  OUTPUT
18
20
  end
19
21
  let(:comments) do
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::EslintCapture do
4
6
  let(:output) do
5
- <<-OUTPUT
6
- jsapp/models/user.js
7
- 4:21 error Missing semicolon semi
8
- 5:1 warning Too much cowbell cowbell-overload
7
+ <<~OUTPUT
8
+ jsapp/models/user.js
9
+ 4:21 error Missing semicolon semi
10
+ 5:1 warning Too much cowbell cowbell-overload
9
11
  OUTPUT
10
12
  end
11
13
  let(:comments) do
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::Flake8Capture do
4
6
  let(:output) do
5
- <<-OUTPUT
6
- ./djangogeneric/settings/base.py:73:80: E501 line too long (81 > 79 characters)
7
+ <<~OUTPUT
8
+ ./djangogeneric/settings/base.py:73:80: E501 line too long (81 > 79 characters)
7
9
  OUTPUT
8
10
  end
9
11
  let(:comments) do
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::I18nlinerCapture do
4
6
  let(:output) do
5
- <<-OUTPUT
6
- 1)
7
- invalid signature on line 4: <unsupported expression>
8
- jsapp/models/user.js
7
+ <<~OUTPUT
8
+ 1)
9
+ invalid signature on line 4: <unsupported expression>
10
+ jsapp/models/user.js
9
11
  OUTPUT
10
12
  end
11
13
  let(:comments) do
@@ -1,22 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::RubocopCapture do
4
6
  let(:output) do
5
- <<-OUTPUT
6
- Offenses:
7
+ <<~OUTPUT
8
+ Offenses:
7
9
 
8
- bin/gergich:47:8: C: Prefer double-quoted strings
9
- if ENV['DEBUG']
10
- ^^^^^^^
11
- foo/bar/baz.rb:1:2: W: no context for this one :shrug:
12
- lib/gergich.rb:10:9: E: this is a terrible name
10
+ bin/gergich:47:8: C: Prefer double-quoted strings
11
+ if ENV['DEBUG']
12
+ ^^^^^^^
13
+ foo/bar/baz.rb:1:2: W: no context for this one :shrug:
14
+ lib/gergich.rb:10:9: E: this is a terrible name
13
15
 
14
- seriously, what were you thinking?
15
- def foo
16
- ^^^
17
- lib/gergich.rb:22:55: W: Line is too long. [55/54]
18
- def initialize(ref = "HEAD", revision_number = nil)
19
- ^^
16
+ seriously, what were you thinking?
17
+ def foo
18
+ ^^^
19
+ lib/gergich.rb:22:55: W: Line is too long. [55/54]
20
+ def initialize(ref = "HEAD", revision_number = nil)
21
+ ^^
20
22
  OUTPUT
21
23
  end
22
24
  let(:comments) do
@@ -36,24 +38,24 @@ lib/gergich.rb:22:55: W: Line is too long. [55/54]
36
38
  {
37
39
  path: "lib/gergich.rb",
38
40
  position: 10,
39
- message: <<-OUTPUT,
40
- [rubocop] this is a terrible name
41
+ message: <<~OUTPUT,
42
+ [rubocop] this is a terrible name
41
43
 
42
- seriously, what were you thinking?
44
+ seriously, what were you thinking?
43
45
 
44
- def foo
45
- ^^^
46
+ def foo
47
+ ^^^
46
48
  OUTPUT
47
49
  severity: "error"
48
50
  },
49
51
  {
50
52
  path: "lib/gergich.rb",
51
53
  position: 22,
52
- message: <<-OUTPUT,
53
- [rubocop] Line is too long. [55/54]
54
+ message: <<~OUTPUT,
55
+ [rubocop] Line is too long. [55/54]
54
56
 
55
- def initialize(ref = "HEAD", revision_number = nil)
56
- ^^
57
+ def initialize(ref = "HEAD", revision_number = nil)
58
+ ^^
57
59
  OUTPUT
58
60
  severity: "warn"
59
61
  }
@@ -1,50 +1,52 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::ShellcheckCapture do
4
6
  let(:output) do
5
- <<-'OUTPUT'
6
- [
7
- {
8
- "file": "bin/sync-translations.sh",
9
- "line": 23,
10
- "endLine": 23,
11
- "column": 21,
12
- "endColumn": 21,
13
- "level": "style",
14
- "code": 2006,
15
- "message": "Use $(..) instead of legacy `..`."
16
- },
17
- {
18
- "file": "bin/sync-translations.sh",
19
- "line": 23,
20
- "endLine": 23,
21
- "column": 43,
22
- "endColumn": 43,
23
- "level": "warning",
24
- "code": 2046,
25
- "message": "Quote this to prevent word splitting."
26
- },
27
- {
28
- "file": "bin/sync-translations.sh",
29
- "line": 32,
30
- "endLine": 32,
31
- "column": 62,
32
- "endColumn": 62,
33
- "level": "info",
34
- "code": 2086,
35
- "message": "Double quote to prevent globbing and word splitting."
36
- },
37
- {
38
- "file": "fail.sh",
39
- "line": 3,
40
- "endLine": 3,
41
- "column": 12,
42
- "endColumn": 12,
43
- "level": "error",
44
- "code": 1101,
45
- "message": "Delete trailing spaces after \\ to break line (or use quotes for literal space)."
46
- }
47
- ]
7
+ <<~'OUTPUT'
8
+ [
9
+ {
10
+ "file": "bin/sync-translations.sh",
11
+ "line": 23,
12
+ "endLine": 23,
13
+ "column": 21,
14
+ "endColumn": 21,
15
+ "level": "style",
16
+ "code": 2006,
17
+ "message": "Use $(..) instead of legacy `..`."
18
+ },
19
+ {
20
+ "file": "bin/sync-translations.sh",
21
+ "line": 23,
22
+ "endLine": 23,
23
+ "column": 43,
24
+ "endColumn": 43,
25
+ "level": "warning",
26
+ "code": 2046,
27
+ "message": "Quote this to prevent word splitting."
28
+ },
29
+ {
30
+ "file": "bin/sync-translations.sh",
31
+ "line": 32,
32
+ "endLine": 32,
33
+ "column": 62,
34
+ "endColumn": 62,
35
+ "level": "info",
36
+ "code": 2086,
37
+ "message": "Double quote to prevent globbing and word splitting."
38
+ },
39
+ {
40
+ "file": "fail.sh",
41
+ "line": 3,
42
+ "endLine": 3,
43
+ "column": 12,
44
+ "endColumn": 12,
45
+ "level": "error",
46
+ "code": 1101,
47
+ "message": "Delete trailing spaces after \\ to break line (or use quotes for literal space)."
48
+ }
49
+ ]
48
50
  OUTPUT
49
51
  end
50
52
 
@@ -1,15 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::StylelintCapture do
4
6
  let(:output) do
5
- <<-OUTPUT
6
- app/stylesheets/base/_print.scss
7
- 3:17 ✖ Unexpected invalid hex color "#owiehfi" color-no-invalid-hex
8
- 3:17 ⚠ Expected "#owiehfi" to be "#OWIEHFI" color-hex-case
7
+ <<~OUTPUT
8
+ app/stylesheets/base/_print.scss
9
+ 3:17 ✖ Unexpected invalid hex color "#owiehfi" color-no-invalid-hex
10
+ 3:17 ⚠ Expected "#owiehfi" to be "#OWIEHFI" color-hex-case
9
11
 
10
- app/stylesheets/base/_variables.scss
11
- 2:15 ✖ Unexpected invalid hex color "#2D3B4" color-no-invalid-hex
12
- 30:15 ⚠ Expected "#2d3b4a" to be "#2D3B4A" color-hex-case
12
+ app/stylesheets/base/_variables.scss
13
+ 2:15 ✖ Unexpected invalid hex color "#2D3B4" color-no-invalid-hex
14
+ 30:15 ⚠ Expected "#2d3b4a" to be "#2D3B4A" color-hex-case
15
+ 45:12 ℹ Expected "#2d3b4a" to be "#2D3B4A" color-hex-case
13
16
  OUTPUT
14
17
  end
15
18
  let(:comments) do
@@ -37,6 +40,12 @@ app/stylesheets/base/_variables.scss
37
40
  position: 30,
38
41
  message: "[stylelint] Expected \"#2d3b4a\" to be \"#2D3B4A\"",
39
42
  severity: "warn"
43
+ },
44
+ {
45
+ path: "app/stylesheets/base/_variables.scss",
46
+ position: 45,
47
+ message: "[stylelint] Expected \"#2d3b4a\" to be \"#2D3B4A\"",
48
+ severity: "info"
40
49
  }
41
50
  ]
42
51
  end
@@ -1,15 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../support/capture_shared_examples"
2
4
 
3
5
  RSpec.describe Gergich::Capture::SwiftlintCapture do
4
- # rubocop:disable Metrics/LineLength
6
+ # rubocop:disable Layout/LineLength
5
7
  let(:colon_violation) { "Colon Violation: Colons should be next to the identifier when specifying a type. (colon)" }
6
8
  let(:line_length_violation) { "Line Length Violation: Line should be 100 characters or less: currently 129 characters (line_length)" }
7
9
  let(:force_cast_violation) { "Force Cast Violation: Force casts should be avoided. (force_cast)" }
10
+ # rubocop:enable Layout/LineLength
8
11
  let(:output) do
9
- <<-OUTPUT
10
- /path/to/My.swift:13:22: warning: #{colon_violation}
11
- /path/to/Fail.swift:76: warning: #{line_length_violation}
12
- /path/to/Cast.swift:15:9: error: #{force_cast_violation}
12
+ <<~OUTPUT
13
+ /path/to/My.swift:13:22: warning: #{colon_violation}
14
+ /path/to/Fail.swift:76: warning: #{line_length_violation}
15
+ /path/to/Cast.swift:15:9: error: #{force_cast_violation}
13
16
  OUTPUT
14
17
  end
15
18
  let(:comments) do
@@ -1,13 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../../lib/gergich/capture"
2
4
 
3
5
  RSpec.describe Gergich::Capture do
4
6
  let!(:draft) { double }
5
7
 
6
8
  let :output do
7
- <<-OUTPUT
8
- #{path}
9
- 4:21 error Missing semicolon semi
10
- OUTPUT
9
+ <<~OUTPUT
10
+ #{path}
11
+ 4:21 error Missing semicolon semi
12
+ OUTPUT
11
13
  end
12
14
 
13
15
  before do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Gergich::API do
2
4
  context "bad change-id" do
3
5
  let(:result) { double(:result, body: "Not Found: 1234") }
@@ -88,6 +90,21 @@ RSpec.describe Gergich::Draft do
88
90
  draft.reset!
89
91
  end
90
92
 
93
+ context "#GERGICH_DB_PATH" do
94
+ it "uses the custom path" do
95
+ original_db_path = ENV["GERGICH_DB_PATH"]
96
+ ENV["GERGICH_DB_PATH"] = "/custom"
97
+
98
+ expect(draft.db_file).to eq("/custom/gergich-test.sqlite3")
99
+
100
+ ENV["GERGICH_DB_PATH"] = original_db_path
101
+ end
102
+
103
+ it "uses the default path" do
104
+ expect(draft.db_file).to eq("/tmp/gergich-test.sqlite3")
105
+ end
106
+ end
107
+
91
108
  describe "#info" do
92
109
  subject { draft.info }
93
110
 
@@ -99,6 +116,11 @@ RSpec.describe Gergich::Draft do
99
116
  expect(subject).to eq("foo.rb" => [{ line: 1, message: "[INFO] fix foo" }])
100
117
  end
101
118
 
119
+ it "strips whitespace from filename" do
120
+ draft.add_comment " foo.rb\n", 1, "fix foo", "info"
121
+ expect(subject).to eq("foo.rb" => [{ line: 1, message: "[INFO] fix foo" }])
122
+ end
123
+
102
124
  it "includes COMMIT_MSG comments" do
103
125
  draft.add_comment "/COMMIT_MSG", 1, "fix commit", "info"
104
126
  expect(subject).to eq("/COMMIT_MSG" => [{ line: 1, message: "[INFO] fix commit" }])
@@ -210,16 +232,18 @@ RSpec.describe Gergich::Draft do
210
232
  end
211
233
 
212
234
  RSpec.describe Gergich::Review do
235
+ let(:change_id) { "test" }
213
236
  let!(:commit) do
214
237
  double(
215
238
  :commit,
239
+ change_id: change_id,
216
240
  files: [
217
241
  "foo.rb",
218
242
  "bar/baz.lol"
219
243
  ],
220
- revision_id: "test",
221
- revision_number: 1,
222
- change_id: "test"
244
+ info: {},
245
+ revision_id: change_id,
246
+ revision_number: 1
223
247
  )
224
248
  end
225
249
  let!(:draft) do
@@ -231,6 +255,37 @@ RSpec.describe Gergich::Review do
231
255
  draft.reset!
232
256
  end
233
257
 
258
+ describe "#status" do
259
+ subject { review.status }
260
+
261
+ context "nothing to publish" do
262
+ before :each do
263
+ allow(review).to receive(:anything_to_publish?).and_return(false)
264
+ end
265
+ it { expect { subject }.to output(include("Nothing to publish")).to_stdout }
266
+ end
267
+
268
+ context "something to publish" do
269
+ before :each do
270
+ allow(review).to receive(:anything_to_publish?).and_return(true)
271
+ allow(review).to receive(:already_commented?).and_return(false)
272
+ allow(review).to receive(:generate_payload).and_return({})
273
+ allow(review).to receive(:my_messages).and_return([])
274
+ end
275
+ it {
276
+ expected_outputs = [
277
+ "Project:",
278
+ "Branch:",
279
+ "Revision:",
280
+ "ChangeId: #{change_id}",
281
+ "Files:"
282
+ # There's more... but this is good
283
+ ]
284
+ expect { subject }.to output(include(*expected_outputs)).to_stdout
285
+ }
286
+ end
287
+ end
288
+
234
289
  describe "#publish!" do
235
290
  context "nothing to publish" do
236
291
  before :each do
@@ -253,7 +308,6 @@ RSpec.describe Gergich::Review do
253
308
 
254
309
  it "publishes via the api" do
255
310
  expect(Gergich::API).to receive(:post)
256
- allow(review).to receive(:change_name?).and_return(false)
257
311
  review.publish!
258
312
  end
259
313
  end