File: spec_helper.rb

package info (click to toggle)
ruby-batch-loader 2.0.1%2Bdfsg-2~bpo11%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye-backports
  • size: 248 kB
  • sloc: ruby: 767; makefile: 5; sh: 4
file content (38 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (3)
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
#require "bundler/setup"

if ENV['CI']
  require 'coveralls'
  Coveralls.wear!
end

require "batch_loader"

require "graphql"
require_relative "./fixtures/models"
require_relative "./fixtures/graphql_schema"

class SlowExecutorProxy < BatchLoader::ExecutorProxy
  def value_loaded?(item:)
    result = loaded.key?(item)
    sleep 0.5
    result
  end
end

RSpec.configure do |config|
  # Enable flags like --only-failures and --next-failure
  config.example_status_persistence_file_path = ".rspec_status"

  # Disable RSpec exposing methods globally on `Module` and `main`
  config.disable_monkey_patching!

  config.order = :random

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.after do
    BatchLoader::Executor.clear_current
  end
end