grizzly-rb 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +58 -0
- data/.gitignore +13 -0
- data/.rubocop.yml +23 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +56 -0
- data/LICENSE.txt +21 -0
- data/README.md +192 -0
- data/Rakefile +16 -0
- data/benchmark.rb +59 -0
- data/benchmark.txt +73 -0
- data/bin/console +22 -0
- data/bin/convert +15 -0
- data/bin/setup +11 -0
- data/bin/spec/convert +27 -0
- data/bin/spec/reset +9 -0
- data/bin/spec/setup +20 -0
- data/bin/test +38 -0
- data/config/mspec_override.rb +44 -0
- data/config/skipped_tests.yml +104 -0
- data/conversion/Gemfile +7 -0
- data/conversion/Gemfile.lock +53 -0
- data/conversion/bin/rspec +27 -0
- data/conversion/lib/cops/array_initialization.rb +95 -0
- data/conversion/lib/cops/enumerator_initialization.rb +56 -0
- data/conversion/lib/cops/grep_implementation.rb +36 -0
- data/conversion/lib/cops/instance_of_array.rb +24 -0
- data/conversion/lib/cops/subclass_initialization.rb +47 -0
- data/conversion/lib/cops.rb +6 -0
- data/conversion/spec/.DS_Store +0 -0
- data/conversion/spec/cops/array_initialization_spec.rb +154 -0
- data/conversion/spec/cops/enumerator_initialization_spec.rb +105 -0
- data/conversion/spec/cops/grep_implementation_spec.rb +57 -0
- data/conversion/spec/cops/instance_of_array_spec.rb +38 -0
- data/conversion/spec/cops/subclass_initialization_spec.rb +26 -0
- data/conversion/spec/spec_helper.rb +104 -0
- data/examples/transactions.rb +278 -0
- data/grizzly-group.gemspec +28 -0
- data/lib/grizzly/collection.rb +77 -0
- data/lib/grizzly/enumerable.rb +120 -0
- data/lib/grizzly/enumerator-backup.rb +114 -0
- data/lib/grizzly/enumerator.rb +63 -0
- data/lib/grizzly/lazy_enumerator.rb +40 -0
- data/lib/grizzly/version.rb +3 -0
- data/lib/grizzly.rb +8 -0
- metadata +89 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
describe ArrayInitialization, :config do
|
7
|
+
include RuboCop::RSpec::ExpectOffense
|
8
|
+
|
9
|
+
before do
|
10
|
+
cop_config['InitializeArrayWith'] = 'AnotherClass'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'registers an offense for @origin = [true, false]' do
|
14
|
+
expect_offense(<<~RUBY)
|
15
|
+
@origin = [true, false]
|
16
|
+
^^^^^^^^^^^^^ an Array should not be initialized with the literal constructor []
|
17
|
+
RUBY
|
18
|
+
|
19
|
+
expect_correction(<<~RUBY)
|
20
|
+
@origin = AnotherClass.new([true, false])
|
21
|
+
RUBY
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'registers an offense when using #to_a constructor' do
|
25
|
+
expect_offense(<<~RUBY)
|
26
|
+
a = (1..3).to_a
|
27
|
+
^^^^^^^^^^^ an Array should not be initialized with #to_a
|
28
|
+
RUBY
|
29
|
+
|
30
|
+
expect_correction(<<~RUBY)
|
31
|
+
a = AnotherClass.new((1..3).to_a)
|
32
|
+
RUBY
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'registers an offense when using #to_a constructor on a chained method' do
|
36
|
+
expect_offense(<<~RUBY)
|
37
|
+
a = @array.combination(3).to_a
|
38
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^ an Array should not be initialized with #to_a
|
39
|
+
RUBY
|
40
|
+
|
41
|
+
expect_correction(<<~RUBY)
|
42
|
+
a = AnotherClass.new(@array.combination(3).to_a)
|
43
|
+
RUBY
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'registers an offense when using [] literal constructor' do
|
47
|
+
expect_offense(<<~RUBY)
|
48
|
+
a = [1,2,3]
|
49
|
+
^^^^^^^ an Array should not be initialized with the literal constructor []
|
50
|
+
RUBY
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'registers an offense when using an Array initialization' do
|
54
|
+
expect_offense(<<~RUBY)
|
55
|
+
a = Array.new([1, 2, 3])
|
56
|
+
^^^^^^^^^^^^^^^^^^^^ an Array should not be initialized with .new
|
57
|
+
RUBY
|
58
|
+
|
59
|
+
expect_correction(<<~RUBY)
|
60
|
+
a = AnotherClass.new([1, 2, 3])
|
61
|
+
RUBY
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'registers an offense when Array is instantiated with a length' do
|
65
|
+
expect_offense(<<~RUBY)
|
66
|
+
a = Array.new(1) {}
|
67
|
+
^^^^^^^^^^^^ an Array should not be initialized with .new
|
68
|
+
RUBY
|
69
|
+
|
70
|
+
expect_correction(<<~RUBY)
|
71
|
+
a = AnotherClass.new(1) {}
|
72
|
+
RUBY
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'registers an offense when Array is instantiated with a length and a default value' do
|
76
|
+
expect_offense(<<~RUBY)
|
77
|
+
a = Array.new(99, "something")
|
78
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^ an Array should not be initialized with .new
|
79
|
+
RUBY
|
80
|
+
|
81
|
+
expect_correction(<<~RUBY)
|
82
|
+
a = AnotherClass.new(99, "something")
|
83
|
+
RUBY
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'registers an offense when Array is instantiated with two variables' do
|
87
|
+
expect_offense(<<~RUBY)
|
88
|
+
a = Array.new(a, b)
|
89
|
+
^^^^^^^^^^^^^^^ an Array should not be initialized with .new
|
90
|
+
RUBY
|
91
|
+
|
92
|
+
expect_correction(<<~RUBY)
|
93
|
+
a = AnotherClass.new(a, b)
|
94
|
+
RUBY
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'does not register an offense when doing a spec check' do
|
98
|
+
expect_no_offenses(<<~RUBY)
|
99
|
+
a == [1,2,3]
|
100
|
+
RUBY
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'corrects the offense by wrapping the array initialization with a class of choice' do
|
104
|
+
expect_offense(<<~RUBY)
|
105
|
+
a = [1,2,3]
|
106
|
+
^^^^^^^ an Array should not be initialized with the literal constructor []
|
107
|
+
RUBY
|
108
|
+
|
109
|
+
expect_correction(<<~RUBY)
|
110
|
+
a = AnotherClass.new([1, 2, 3])
|
111
|
+
RUBY
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'corrects the offense that does not use the [] constrcution' do
|
115
|
+
expect_offense(<<~RUBY)
|
116
|
+
a = 1,2,3
|
117
|
+
^^^^^ an Array should not be initialized with the literal constructor []
|
118
|
+
RUBY
|
119
|
+
|
120
|
+
expect_correction(<<~RUBY)
|
121
|
+
a = AnotherClass.new([1, 2, 3])
|
122
|
+
RUBY
|
123
|
+
end
|
124
|
+
|
125
|
+
it 'corrects the offense that uses %w() construction' do
|
126
|
+
expect_offense(<<~RUBY)
|
127
|
+
a = %w(1 2 3)
|
128
|
+
^^^^^^^^^ an Array should not be initialized with the literal constructor []
|
129
|
+
RUBY
|
130
|
+
|
131
|
+
expect_correction(<<~RUBY)
|
132
|
+
a = AnotherClass.new(["1", "2", "3"])
|
133
|
+
RUBY
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'corrects the offense with the constant configured in rubocop file' do
|
137
|
+
old_config = cop_config['InitializeArrayWith'].dup
|
138
|
+
cop_config['InitializeArrayWith'] = 'Collection'
|
139
|
+
|
140
|
+
expect_offense(<<~RUBY)
|
141
|
+
a = [1,2,3]
|
142
|
+
^^^^^^^ an Array should not be initialized with the literal constructor []
|
143
|
+
RUBY
|
144
|
+
|
145
|
+
expect_correction(<<~RUBY)
|
146
|
+
a = Collection.new([1, 2, 3])
|
147
|
+
RUBY
|
148
|
+
|
149
|
+
cop_config['InitializeArrayWith'] = old_config
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
describe EnumeratorInitialization, :config do
|
7
|
+
include RuboCop::RSpec::ExpectOffense
|
8
|
+
|
9
|
+
before do
|
10
|
+
cop_config['InitializeEnumeratorWith'] = 'AnotherEnumerator'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'registers an offense for chained to_enum' do
|
14
|
+
expect_offense(<<~RUBY)
|
15
|
+
@enum = EnumeratorSpecs::Feed.new.to_enum(:each)
|
16
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #to_enum initialization needs to be wrapped
|
17
|
+
RUBY
|
18
|
+
|
19
|
+
expect_correction(<<~RUBY)
|
20
|
+
@enum = AnotherEnumerator.new(EnumeratorSpecs::Feed.new.to_enum(:each))
|
21
|
+
RUBY
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'registers an offense for simple case' do
|
25
|
+
expect_offense(<<~RUBY)
|
26
|
+
@e = o.to_enum
|
27
|
+
^^^^^^^^^ #to_enum initialization needs to be wrapped
|
28
|
+
RUBY
|
29
|
+
|
30
|
+
expect_correction(<<~RUBY)
|
31
|
+
@e = AnotherEnumerator.new(o.to_enum)
|
32
|
+
RUBY
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'registers an offense for simple case with args' do
|
36
|
+
expect_offense(<<~RUBY)
|
37
|
+
@enum_with_arguments = object_each_with_arguments.to_enum(:each_with_arguments, :arg0, :arg1, :arg2)
|
38
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #to_enum initialization needs to be wrapped
|
39
|
+
RUBY
|
40
|
+
|
41
|
+
expect_correction(<<~RUBY)
|
42
|
+
@enum_with_arguments = AnotherEnumerator.new(object_each_with_arguments.to_enum(:each_with_arguments, :arg0, :arg1, :arg2))
|
43
|
+
RUBY
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'registers an offense for Enumerator initialized with blocks' do
|
47
|
+
expect_offense(<<~RUBY)
|
48
|
+
@e = Enumerator.new {|y| y.yield :ok}
|
49
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #new Enumerator initialization needs to be wrapped
|
50
|
+
RUBY
|
51
|
+
|
52
|
+
expect_correction(<<~RUBY)
|
53
|
+
@e = AnotherEnumerator.new(Enumerator.new {|y| y.yield :ok})
|
54
|
+
RUBY
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'registers an offense for Enumerator initialized with blocks and arguments' do
|
58
|
+
expect_offense(<<~RUBY)
|
59
|
+
@e = Enumerator.new(100) {}
|
60
|
+
^^^^^^^^^^^^^^^^^^^^^^ #new Enumerator initialization needs to be wrapped
|
61
|
+
RUBY
|
62
|
+
|
63
|
+
expect_correction(<<~RUBY)
|
64
|
+
@e = AnotherEnumerator.new(Enumerator.new(100) {})
|
65
|
+
RUBY
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'registers an offense for Enumerator initialized with arguments (ruby 2.7)' do
|
69
|
+
# Enumerator.new(1, :upto, 3)
|
70
|
+
|
71
|
+
expect_offense(<<~RUBY)
|
72
|
+
@e = Enumerator.new(1, :upto, 3)
|
73
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^ #new Enumerator initialization needs to be wrapped
|
74
|
+
RUBY
|
75
|
+
|
76
|
+
expect_correction(<<~RUBY)
|
77
|
+
@e = AnotherEnumerator.new(Enumerator.new(1, :upto, 3))
|
78
|
+
RUBY
|
79
|
+
|
80
|
+
# Enumerator.new(1..2)
|
81
|
+
|
82
|
+
expect_offense(<<~RUBY)
|
83
|
+
@e = Enumerator.new(1..2)
|
84
|
+
^^^^^^^^^^^^^^^^^^^^ #new Enumerator initialization needs to be wrapped
|
85
|
+
RUBY
|
86
|
+
|
87
|
+
expect_correction(<<~RUBY)
|
88
|
+
@e = AnotherEnumerator.new(Enumerator.new(1..2))
|
89
|
+
RUBY
|
90
|
+
|
91
|
+
# Enumerator.new(1..2, :each)
|
92
|
+
|
93
|
+
expect_offense(<<~RUBY)
|
94
|
+
@e = Enumerator.new(1..2, :each)
|
95
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^ #new Enumerator initialization needs to be wrapped
|
96
|
+
RUBY
|
97
|
+
|
98
|
+
expect_correction(<<~RUBY)
|
99
|
+
@e = AnotherEnumerator.new(Enumerator.new(1..2, :each))
|
100
|
+
RUBY
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
describe GrepImplementation, :config do
|
7
|
+
include RuboCop::RSpec::ExpectOffense
|
8
|
+
|
9
|
+
before { cop_config['GrepSupportRubyVersion'] = '3.3' }
|
10
|
+
|
11
|
+
it 'registers an offense for grep specs' do
|
12
|
+
expect_offense(<<~RUBY)
|
13
|
+
describe "Enumerable#grep" do
|
14
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #grep and grep_v cannot be implemented
|
15
|
+
before :each do
|
16
|
+
@a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
RUBY
|
20
|
+
|
21
|
+
expect_correction(<<~RUBY)
|
22
|
+
ruby_bug '#11808', ''...'3.3' do
|
23
|
+
describe "Enumerable#grep" do
|
24
|
+
before :each do
|
25
|
+
@a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
RUBY
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'registers an offense for grep_v specs' do
|
34
|
+
expect_offense(<<~RUBY)
|
35
|
+
describe "Enumerable#grep_v" do
|
36
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #grep and grep_v cannot be implemented
|
37
|
+
before :each do
|
38
|
+
@a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
RUBY
|
42
|
+
|
43
|
+
expect_correction(<<~RUBY)
|
44
|
+
ruby_bug '#11808', ''...'3.3' do
|
45
|
+
describe "Enumerable#grep_v" do
|
46
|
+
before :each do
|
47
|
+
@a = EnumerableSpecs::EachDefiner.new( 2, 4, 6, 8, 10)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
RUBY
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
describe InstanceOfArray, :config do
|
7
|
+
include RuboCop::RSpec::ExpectOffense
|
8
|
+
|
9
|
+
before do
|
10
|
+
cop_config['NewInstanceOf'] = 'Grizzly::Collection'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'registers an offense when using instance_of(Array)' do
|
14
|
+
expect_offense(<<~RUBY)
|
15
|
+
be_an_instance_of(Array)
|
16
|
+
^^^^^^^^^^^^^^^^^^^^^^^^ instance_of should not be of Array
|
17
|
+
RUBY
|
18
|
+
|
19
|
+
expect_correction(<<~RUBY)
|
20
|
+
be_an_instance_of(Grizzly::Collection)
|
21
|
+
RUBY
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'does not register an offense when for a random line' do
|
25
|
+
expect_no_offenses(<<~RUBY)
|
26
|
+
a.untrusted?.should be_true
|
27
|
+
RUBY
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'does not register an offense for other constant than Array' do
|
31
|
+
expect_no_offenses(<<~RUBY)
|
32
|
+
be_an_instance_of(Enumerator)
|
33
|
+
RUBY
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
describe SubclassInitialization, :config do
|
7
|
+
include RuboCop::RSpec::ExpectOffense
|
8
|
+
|
9
|
+
before do
|
10
|
+
cop_config['InitializeArrayWith'] = 'Grizzly::Collection'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'registers an offense when using instance_of(Array)' do
|
14
|
+
expect_offense(<<~RUBY)
|
15
|
+
MyModule::MyArray[1,2,3]
|
16
|
+
^^^^^^^^^^^^^^^^^^^^^^^^ instance_of should not be of Array
|
17
|
+
RUBY
|
18
|
+
|
19
|
+
expect_correction(<<~RUBY)
|
20
|
+
Grizzly::Collection.new([1, 2, 3])
|
21
|
+
RUBY
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
require "byebug"
|
2
|
+
require "rubocop"
|
3
|
+
require "rubocop/rspec/support"
|
4
|
+
require_relative "../lib/cops"
|
5
|
+
|
6
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
7
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
8
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
9
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
10
|
+
# files.
|
11
|
+
#
|
12
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
13
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
14
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
15
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
16
|
+
# a separate helper file that requires the additional dependencies and performs
|
17
|
+
# the additional setup, and require it from the spec files that actually need
|
18
|
+
# it.
|
19
|
+
#
|
20
|
+
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
21
|
+
RSpec.configure do |config|
|
22
|
+
# rspec-expectations config goes here. You can use an alternate
|
23
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
24
|
+
# assertions if you prefer.
|
25
|
+
config.expect_with :rspec do |expectations|
|
26
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
27
|
+
# and `failure_message` of custom matchers include text for helper methods
|
28
|
+
# defined using `chain`, e.g.:
|
29
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
30
|
+
# # => "be bigger than 2 and smaller than 4"
|
31
|
+
# ...rather than:
|
32
|
+
# # => "be bigger than 2"
|
33
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
34
|
+
end
|
35
|
+
|
36
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
37
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
38
|
+
config.mock_with :rspec do |mocks|
|
39
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
40
|
+
# a real object. This is generally recommended, and will default to
|
41
|
+
# `true` in RSpec 4.
|
42
|
+
mocks.verify_partial_doubles = true
|
43
|
+
end
|
44
|
+
|
45
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
46
|
+
# have no way to turn it off -- the option exists only for backwards
|
47
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
48
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
49
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
50
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
51
|
+
|
52
|
+
# The settings below are suggested to provide a good initial experience
|
53
|
+
# with RSpec, but feel free to customize to your heart's content.
|
54
|
+
|
55
|
+
|
56
|
+
# This allows you to limit a spec run to individual examples or groups
|
57
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
58
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
59
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
60
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
61
|
+
config.filter_run_when_matching :focus
|
62
|
+
|
63
|
+
# Allows RSpec to persist some state between runs in order to support
|
64
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
65
|
+
# you configure your source control system to ignore this file.
|
66
|
+
# config.example_status_persistence_file_path = "spec/examples.txt"
|
67
|
+
|
68
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
69
|
+
# recommended. For more details, see:
|
70
|
+
# https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
|
71
|
+
# config.disable_monkey_patching!
|
72
|
+
|
73
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
74
|
+
# be too noisy due to issues in dependencies.
|
75
|
+
# config.warnings = true
|
76
|
+
|
77
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
78
|
+
# file, and it's useful to allow more verbose output when running an
|
79
|
+
# individual spec file.
|
80
|
+
# if config.files_to_run.one?
|
81
|
+
# # Use the documentation formatter for detailed output,
|
82
|
+
# # unless a formatter has already been configured
|
83
|
+
# # (e.g. via a command-line flag).
|
84
|
+
# config.default_formatter = "doc"
|
85
|
+
# end
|
86
|
+
|
87
|
+
# Print the 10 slowest examples and example groups at the
|
88
|
+
# end of the spec run, to help surface which specs are running
|
89
|
+
# particularly slow.
|
90
|
+
# config.profile_examples = 10
|
91
|
+
|
92
|
+
# Run specs in random order to surface order dependencies. If you find an
|
93
|
+
# order dependency and want to debug it, you can fix the order by providing
|
94
|
+
# the seed, which is printed after each run.
|
95
|
+
# --seed 1234
|
96
|
+
config.order = :random
|
97
|
+
|
98
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
99
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
100
|
+
# test failures related to randomization by passing the same `--seed` value
|
101
|
+
# as the one that triggered the failure.
|
102
|
+
Kernel.srand config.seed
|
103
|
+
|
104
|
+
end
|