Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions spec/cc/engine/analyzers/javascript/main_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
require 'spec_helper'
require 'cc/engine/analyzers/javascript/main'
require 'cc/engine/analyzers/reporter'
require 'cc/engine/analyzers/engine_config'
require 'cc/engine/analyzers/file_list'
require 'flay'
require 'tmpdir'

RSpec.describe CC::Engine::Analyzers::Javascript::Main, in_tmpdir: true do
include AnalyzerSpecHelpers
Expand Down Expand Up @@ -93,8 +92,8 @@
<a className='button button-primary full' href='#' onClick={this.onSubmit.bind(this)}>Login</a>
EOJSX

result = run_engine(engine_conf).strip
issues = result.split("\0")
issues = run_engine(engine_conf).strip.split("\0")

expect(issues.length).to eq 1
end

Expand Down
8 changes: 1 addition & 7 deletions spec/cc/engine/analyzers/php/main_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
require 'spec_helper'
require 'cc/engine/analyzers/php/main'
require 'cc/engine/analyzers/reporter'
require 'cc/engine/analyzers/engine_config'
require 'cc/engine/analyzers/file_list'
require 'flay'
require 'tmpdir'

RSpec.describe CC::Engine::Analyzers::Php::Main, in_tmpdir: true do
include AnalyzerSpecHelpers
Expand Down Expand Up @@ -93,11 +92,6 @@
end
end

def printed_issue
issue = {"type":"issue","check_name":"Identical code","description":"Similar code found in 1 other location","categories":["Duplication"],"location":{"path":"foo.php","lines":{"begin":2,"end":6}},"remediation_points":176000,"other_locations":[{"path":"foo.php","lines":{"begin":10,"end":14}}],"content":{"body": read_up}}
issue.to_json + "\0\n"
end

def engine_conf
CC::Engine::Analyzers::EngineConfig.new({
'config' => {
Expand Down
6 changes: 2 additions & 4 deletions spec/cc/engine/analyzers/python/main_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require "spec_helper"
require "cc/engine/analyzers/python/main"
require 'spec_helper'
require 'cc/engine/analyzers/python/main'
require 'cc/engine/analyzers/engine_config'
require 'cc/engine/analyzers/file_list'
require "flay"
require "tmpdir"

RSpec.describe CC::Engine::Analyzers::Python::Main, in_tmpdir: true do
include AnalyzerSpecHelpers
Expand Down
3 changes: 1 addition & 2 deletions spec/cc/engine/analyzers/ruby/main_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
require 'spec_helper'
require 'cc/engine/analyzers/ruby/main'
require 'cc/engine/analyzers/engine_config'
require 'cc/engine/analyzers/file_list'
require 'flay'
require 'tmpdir'

module CC::Engine::Analyzers
RSpec.describe Ruby::Main, in_tmpdir: true do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'bundler/setup'
require 'flay'
require 'tmpdir'

Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f }
Expand Down