Skip to content

Commit b165680

Browse files
committed
separated spec config from helpers
1 parent f7d2cd8 commit b165680

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

spec/spec_config.rb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
require 'simplecov'
2+
3+
SimpleCov.start do
4+
enable_coverage :branch
5+
add_filter "/spec/"
6+
end
7+
8+
require 'minisky'
9+
require 'pp' # needs to be included before fakefs
10+
require 'fakefs/spec_helpers'
11+
require 'webmock/rspec'
12+
13+
RSpec.configure do |config|
14+
# Enable flags like --only-failures and --next-failure
15+
config.example_status_persistence_file_path = ".rspec_status"
16+
17+
config.expect_with :rspec do |c|
18+
c.syntax = [:should, :expect]
19+
end
20+
end
21+
22+
module SimpleCov
23+
module Formatter
24+
class HTMLFormatter
25+
def format(result)
26+
# silence the stdout summary, just save the html files
27+
unless @inline_assets
28+
Dir[File.join(@public_assets_dir, "*")].each do |path|
29+
FileUtils.cp_r(path, asset_output_path, remove_destination: true)
30+
end
31+
end
32+
33+
File.open(File.join(output_path, "index.html"), "wb") do |file|
34+
file.puts template("layout").result(binding)
35+
end
36+
end
37+
end
38+
end
39+
end

spec/spec_helper.rb

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,4 @@
1-
require 'simplecov'
2-
3-
SimpleCov.start do
4-
enable_coverage :branch
5-
add_filter "/spec/"
6-
end
7-
8-
require 'minisky'
9-
require 'pp' # needs to be included before fakefs
10-
11-
require 'fakefs/spec_helpers'
12-
require 'webmock/rspec'
13-
14-
RSpec.configure do |config|
15-
# Enable flags like --only-failures and --next-failure
16-
config.example_status_persistence_file_path = ".rspec_status"
17-
18-
config.expect_with :rspec do |c|
19-
c.syntax = [:should, :expect]
20-
end
21-
end
22-
23-
module SimpleCov
24-
module Formatter
25-
class HTMLFormatter
26-
def format(result)
27-
# silence the stdout summary, just save the html files
28-
unless @inline_assets
29-
Dir[File.join(@public_assets_dir, "*")].each do |path|
30-
FileUtils.cp_r(path, asset_output_path, remove_destination: true)
31-
end
32-
end
33-
34-
File.open(File.join(output_path, "index.html"), "wb") do |file|
35-
file.puts template("layout").result(binding)
36-
end
37-
end
38-
end
39-
end
40-
end
1+
require_relative 'spec_config'
412

423
INVALID_METHOD_NAMES = [
434
'getUsers',

0 commit comments

Comments
 (0)