forked from palkan/action-cable-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec_helper.rb
39 lines (28 loc) · 1005 Bytes
/
spec_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
begin
require "pry-byebug"
rescue LoadError
end
require "action_controller/railtie"
require "action_view/railtie"
require "action_cable"
require "action_cable/testing/rspec"
require "ammeter/init"
# Require all the stubs and models
Dir[File.expand_path("../test/stubs/*.rb", __dir__)].each { |file| require file }
# # Set test adapter and logger
ActionCable.server.config.cable = { "adapter" => "test" }
ActionCable.server.config.logger =
ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
Dir[File.expand_path("support/**/*.rb", __dir__)].each { |f| require f }
RSpec.configure do |config|
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
config.filter_run :focus
config.run_all_when_everything_filtered = true
config.order = :random
Kernel.srand config.seed
end