zapata 0.1.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +7 -0
- data/.rspec +1 -0
- data/.rubocop.yml +35 -0
- data/.travis.yml +13 -19
- data/Appraisals +11 -0
- data/Gemfile +2 -0
- data/README.md +1 -2
- data/Rakefile +2 -1
- data/bin/zapata +6 -29
- data/gemfiles/5.2.gemfile +14 -0
- data/gemfiles/6.0.gemfile +14 -0
- data/lib/zapata.rb +22 -22
- data/lib/zapata/analyst.rb +2 -0
- data/lib/zapata/cli.rb +23 -0
- data/lib/zapata/core.rb +11 -0
- data/lib/zapata/core/collector.rb +2 -0
- data/lib/zapata/core/loader.rb +6 -4
- data/lib/zapata/core/reader.rb +2 -0
- data/lib/zapata/core/writer.rb +2 -0
- data/lib/zapata/db.rb +2 -0
- data/lib/zapata/diver.rb +32 -28
- data/lib/zapata/predictor.rb +10 -0
- data/lib/zapata/predictor/args.rb +2 -0
- data/lib/zapata/predictor/chooser.rb +2 -0
- data/lib/zapata/predictor/value.rb +7 -3
- data/lib/zapata/primitive.rb +28 -0
- data/lib/zapata/primitive/arg.rb +2 -0
- data/lib/zapata/primitive/array.rb +2 -0
- data/lib/zapata/primitive/base.rb +6 -4
- data/lib/zapata/primitive/basic.rb +2 -0
- data/lib/zapata/primitive/casgn.rb +2 -0
- data/lib/zapata/primitive/const.rb +2 -0
- data/lib/zapata/primitive/const_send.rb +2 -0
- data/lib/zapata/primitive/def.rb +2 -0
- data/lib/zapata/primitive/defs.rb +3 -1
- data/lib/zapata/primitive/hash.rb +2 -0
- data/lib/zapata/primitive/ivar.rb +2 -0
- data/lib/zapata/primitive/klass.rb +4 -2
- data/lib/zapata/primitive/lvar.rb +2 -0
- data/lib/zapata/primitive/missing.rb +2 -0
- data/lib/zapata/primitive/modul.rb +2 -0
- data/lib/zapata/primitive/nil.rb +2 -0
- data/lib/zapata/primitive/optarg.rb +2 -0
- data/lib/zapata/primitive/raw.rb +2 -0
- data/lib/zapata/primitive/send.rb +4 -1
- data/lib/zapata/primitive/sklass.rb +3 -1
- data/lib/zapata/primitive/var.rb +2 -0
- data/lib/zapata/printer.rb +2 -1
- data/lib/zapata/rzpec/runner.rb +3 -1
- data/lib/zapata/rzpec/writer.rb +5 -3
- data/lib/zapata/version.rb +3 -1
- data/spec/array_spec.rb +6 -6
- data/spec/definition_spec.rb +5 -5
- data/spec/generation_spec.rb +2 -36
- data/spec/hash_spec.rb +8 -8
- data/spec/klass_types_spec.rb +6 -6
- data/spec/send_spec.rb +6 -6
- data/spec/simple_types_spec.rb +6 -6
- data/spec/spec_helper.rb +18 -76
- data/spec/support/rails_test_app/app/assets/config/manifest.js +3 -0
- data/spec/support/rails_test_app/app/models/robot_to_test.rb +4 -4
- data/spec/support/rails_test_app/app/models/test_send.rb +1 -1
- data/spec/support/rails_test_app/config.ru +1 -1
- data/spec/support/rails_test_app/config/initializers/cookies_serializer.rb +1 -1
- data/spec/support/rails_test_app/spec/models/robot_to_test_spec.rb +2 -2
- data/spec/support/rails_test_app/spec/models/test_hash_spec.rb +1 -1
- data/spec/support/rails_test_app/spec/rails_helper.rb +3 -3
- data/spec/support/rails_test_app/spec/spec_helper.rb +58 -60
- data/zapata.gemspec +18 -18
- metadata +58 -101
- data/spec/support/rails_test_app/.gitignore +0 -16
- data/spec/support/rails_test_app/.rspec +0 -3
- data/spec/support/rails_test_app/Gemfile +0 -49
- data/spec/support/rails_test_app/test/controllers/.keep +0 -0
- data/spec/support/rails_test_app/test/fixtures/.keep +0 -0
- data/spec/support/rails_test_app/test/helpers/.keep +0 -0
- data/spec/support/rails_test_app/test/integration/.keep +0 -0
- data/spec/support/rails_test_app/test/mailers/.keep +0 -0
- data/spec/support/rails_test_app/test/models/.keep +0 -0
- data/spec/support/rails_test_app/test/test_helper.rb +0 -13
- data/spec/support/rails_test_app/vendor/assets/javascripts/.keep +0 -0
- data/spec/support/rails_test_app/vendor/assets/stylesheets/.keep +0 -0
data/spec/hash_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
describe Zapata::Revolutionist do
|
4
4
|
before(:all) do
|
@@ -6,38 +6,38 @@ describe Zapata::Revolutionist do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it '#test_in_arg' do
|
9
|
-
has_block('#test_in_arg', %
|
9
|
+
has_block('#test_in_arg', %{
|
10
10
|
expect(test_hash.test_in_arg({ 1 => :one, TestHash => 2.718 })).to eq({ 1 => :one, TestHash => 2.718 })
|
11
11
|
})
|
12
12
|
end
|
13
13
|
|
14
14
|
it '#test_nested_one_level' do
|
15
|
-
has_block('#test_nested_one_level', %
|
15
|
+
has_block('#test_nested_one_level', %{
|
16
16
|
expect(test_hash.test_nested_one_level({ first_level: { 1 => :one, TestHash => 2.718 } })).to eq({ first_level: { 1 => :one, TestHash => 2.718 } })
|
17
17
|
})
|
18
18
|
end
|
19
19
|
|
20
20
|
it '#test_nested_two_levels' do
|
21
|
-
has_block('#test_nested_two_levels', %
|
21
|
+
has_block('#test_nested_two_levels', %{
|
22
22
|
expect(test_hash.test_nested_two_levels({ second_level: { first_level: { 1 => :one, TestHash => 2.718 } } })).to eq({ second_level: { first_level: { 1 => :one, TestHash => 2.718 } } })
|
23
23
|
})
|
24
24
|
end
|
25
25
|
|
26
26
|
it '#test_nested_three_levels' do
|
27
|
-
has_block('#test_nested_three_levels', %
|
27
|
+
has_block('#test_nested_three_levels', %{
|
28
28
|
expect(test_hash.test_nested_three_levels({ third_level: { second_level: { first_level: { 1 => :one, TestHash => 2.718 } } } })).to eq({ third_level: { second_level: { first_level: { 1 => :one, TestHash => 2.718 } } } })
|
29
29
|
})
|
30
30
|
end
|
31
31
|
|
32
32
|
it '#test_key_as_another_hash' do
|
33
|
-
has_block('#test_key_as_another_hash', %
|
33
|
+
has_block('#test_key_as_another_hash', %{
|
34
34
|
expect(test_hash.test_key_as_another_hash({ { 1 => :one, TestHash => 2.718 } => :ratm })).to eq({ { 1 => :one, TestHash => 2.718 } => :ratm })
|
35
35
|
})
|
36
36
|
end
|
37
37
|
|
38
38
|
it '#test_keys_are_symbols' do
|
39
|
-
has_block('#test_keys_are_symbols', %
|
40
|
-
expect(test_hash.test_keys_are_symbols({ this: 'should', be: 'pretty' })).to eq({
|
39
|
+
has_block('#test_keys_are_symbols', %{
|
40
|
+
expect(test_hash.test_keys_are_symbols({ this: 'should', be: 'pretty' })).to eq({ be: 'pretty', this: 'should' })
|
41
41
|
})
|
42
42
|
end
|
43
43
|
end
|
data/spec/klass_types_spec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
describe Zapata::Revolutionist do
|
4
4
|
context 'it should work with' do
|
5
5
|
it 'bare module' do
|
6
6
|
generated = exec_generation('app/models/testing_module/bare.rb')
|
7
|
-
expected = expected(%
|
7
|
+
expected = expected(%{require 'rails_helper'
|
8
8
|
|
9
9
|
describe TestingModule::Bare do
|
10
10
|
let(:bare) do
|
@@ -17,7 +17,7 @@ describe Zapata::Revolutionist do
|
|
17
17
|
|
18
18
|
it 'nested module' do
|
19
19
|
generated = exec_generation('app/models/testing_module/nested/inside.rb')
|
20
|
-
expected = expected(%
|
20
|
+
expected = expected(%{require 'rails_helper'
|
21
21
|
|
22
22
|
describe TestingModule::Nested::Inside do
|
23
23
|
let(:inside) do
|
@@ -34,19 +34,19 @@ describe Zapata::Revolutionist do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it '#defined_with_self' do
|
37
|
-
has_block('#defined_with_self', %
|
37
|
+
has_block('#defined_with_self', %{
|
38
38
|
expect(TestingModule::KlassMethods.defined_with_self(5)).to eq(5)
|
39
39
|
})
|
40
40
|
end
|
41
41
|
|
42
42
|
it '#defined_with_back_back_self' do
|
43
|
-
has_block('#defined_with_back_back_self', %
|
43
|
+
has_block('#defined_with_back_back_self', %{
|
44
44
|
expect(TestingModule::KlassMethods.defined_with_back_back_self(5)).to eq(5)
|
45
45
|
})
|
46
46
|
end
|
47
47
|
|
48
48
|
it '#back_to_public_defined_with_self' do
|
49
|
-
has_block('#back_to_public_defined_with_self', %
|
49
|
+
has_block('#back_to_public_defined_with_self', %{
|
50
50
|
expect(TestingModule::KlassMethods.back_to_public_defined_with_self(5)).to eq(5)
|
51
51
|
})
|
52
52
|
end
|
data/spec/send_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
describe Zapata::Revolutionist do
|
4
4
|
before(:all) do
|
@@ -6,7 +6,7 @@ describe Zapata::Revolutionist do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it '#another_method_as_arg' do
|
9
|
-
has_block('#another_method_as_arg', %
|
9
|
+
has_block('#another_method_as_arg', %{
|
10
10
|
expect(test_send.another_method_as_arg('Help method')).to eq('Help method')
|
11
11
|
})
|
12
12
|
end
|
@@ -30,25 +30,25 @@ describe Zapata::Revolutionist do
|
|
30
30
|
# end
|
31
31
|
|
32
32
|
it '#to_another_object' do
|
33
|
-
has_block('#to_another_object', %
|
33
|
+
has_block('#to_another_object', %{
|
34
34
|
expect(test_send.to_another_object(AnotherObject.my_name)).to eq('Domas')
|
35
35
|
})
|
36
36
|
end
|
37
37
|
|
38
38
|
it '#to_another_object_with_params' do
|
39
|
-
has_block('#to_another_object_with_params', %
|
39
|
+
has_block('#to_another_object_with_params', %{
|
40
40
|
expect(test_send.to_another_object_with_params(AnotherObject.send_with_params(12))).to eq('Id was 12')
|
41
41
|
})
|
42
42
|
end
|
43
43
|
|
44
44
|
it '#not_explicit_with_params' do
|
45
|
-
has_block('#not_explicit_with_params', %
|
45
|
+
has_block('#not_explicit_with_params', %{
|
46
46
|
expect(test_send.not_explicit_with_params('Could you find it?')).to eq('Could you find it?')
|
47
47
|
})
|
48
48
|
end
|
49
49
|
|
50
50
|
it '#fail_to_understand' do
|
51
|
-
has_block('#fail_to_understand', %
|
51
|
+
has_block('#fail_to_understand', %{
|
52
52
|
expect(test_send.fail_to_understand('Missing "failure"')).to eq('Missing "failure"')
|
53
53
|
})
|
54
54
|
end
|
data/spec/simple_types_spec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
describe Zapata::Revolutionist do
|
4
4
|
context 'it should work with' do
|
5
5
|
it 'ints' do
|
6
6
|
generated = exec_generation('app/models/test_int.rb')
|
7
|
-
expected = expected(%
|
7
|
+
expected = expected(%{require 'rails_helper'
|
8
8
|
|
9
9
|
describe TestInt do
|
10
10
|
let(:test_int) do
|
@@ -21,7 +21,7 @@ describe Zapata::Revolutionist do
|
|
21
21
|
|
22
22
|
it 'symbols' do
|
23
23
|
generated = exec_generation('app/models/test_sym.rb')
|
24
|
-
expected = expected(%
|
24
|
+
expected = expected(%{require 'rails_helper'
|
25
25
|
|
26
26
|
describe TestSym do
|
27
27
|
let(:test_sym) do
|
@@ -38,7 +38,7 @@ describe Zapata::Revolutionist do
|
|
38
38
|
|
39
39
|
it 'strings' do
|
40
40
|
generated = exec_generation('app/models/test_str.rb')
|
41
|
-
expected = expected(%
|
41
|
+
expected = expected(%{require 'rails_helper'
|
42
42
|
|
43
43
|
describe TestStr do
|
44
44
|
let(:test_str) do
|
@@ -55,7 +55,7 @@ describe Zapata::Revolutionist do
|
|
55
55
|
|
56
56
|
it 'floats' do
|
57
57
|
generated = exec_generation('app/models/test_float.rb')
|
58
|
-
expected = expected(%
|
58
|
+
expected = expected(%{require 'rails_helper'
|
59
59
|
|
60
60
|
describe TestFloat do
|
61
61
|
let(:test_float) do
|
@@ -72,7 +72,7 @@ describe Zapata::Revolutionist do
|
|
72
72
|
|
73
73
|
it 'consts' do
|
74
74
|
generated = exec_generation('app/models/test_const.rb')
|
75
|
-
expected = expected(%
|
75
|
+
expected = expected(%{require 'rails_helper'
|
76
76
|
|
77
77
|
describe TestConst do
|
78
78
|
let(:test_const) do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,90 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'coveralls'
|
4
|
+
|
2
5
|
Coveralls.wear!
|
3
6
|
|
4
7
|
require 'zapata'
|
5
8
|
|
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 this
|
9
|
-
# file to always be loaded, without a need to explicitly require it in any files.
|
10
|
-
#
|
11
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
12
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
13
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
14
|
-
# individual file that may not need all of that loaded. Instead, make a
|
15
|
-
# separate helper file that requires this one and then use it only in the specs
|
16
|
-
# that actually need it.
|
17
|
-
#
|
18
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
19
|
-
# users commonly want.
|
20
|
-
#
|
21
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
22
9
|
RSpec.configure do |config|
|
23
|
-
#
|
24
|
-
|
25
|
-
=begin
|
26
|
-
# These two settings work together to allow you to limit a spec run
|
27
|
-
# to individual examples or groups you care about by tagging them with
|
28
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
29
|
-
# get run.
|
30
|
-
config.filter_run :focus
|
31
|
-
config.run_all_when_everything_filtered = true
|
32
|
-
|
33
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
34
|
-
# file, and it's useful to allow more verbose output when running an
|
35
|
-
# individual spec file.
|
36
|
-
if config.files_to_run.one?
|
37
|
-
# Use the documentation formatter for detailed output,
|
38
|
-
# unless a formatter has already been configured
|
39
|
-
# (e.g. via a command-line flag).
|
40
|
-
config.default_formatter = 'doc'
|
41
|
-
end
|
42
|
-
|
43
|
-
# Print the 10 slowest examples and example groups at the
|
44
|
-
# end of the spec run, to help surface which specs are running
|
45
|
-
# particularly slow.
|
46
|
-
config.profile_examples = 10
|
47
|
-
|
48
|
-
# Run specs in random order to surface order dependencies. If you find an
|
49
|
-
# order dependency and want to debug it, you can fix the order by providing
|
50
|
-
# the seed, which is printed after each run.
|
51
|
-
# --seed 1234
|
52
|
-
config.order = :random
|
53
|
-
|
54
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
55
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
56
|
-
# test failures related to randomization by passing the same `--seed` value
|
57
|
-
# as the one that triggered the failure.
|
58
|
-
Kernel.srand config.seed
|
10
|
+
# Enable flags like --only-failures and --next-failure
|
11
|
+
config.example_status_persistence_file_path = '.rspec_status'
|
59
12
|
|
60
|
-
|
61
|
-
|
62
|
-
# assertions if you prefer.
|
63
|
-
config.expect_with :rspec do |expectations|
|
64
|
-
# Enable only the newer, non-monkey-patching expect syntax.
|
65
|
-
# For more details, see:
|
66
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
67
|
-
expectations.syntax = :expect
|
13
|
+
config.expect_with :rspec do |c|
|
14
|
+
c.syntax = :expect
|
68
15
|
end
|
69
|
-
|
70
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
71
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
72
|
-
config.mock_with :rspec do |mocks|
|
73
|
-
# Enable only the newer, non-monkey-patching expect syntax.
|
74
|
-
# For more details, see:
|
75
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
76
|
-
mocks.syntax = :expect
|
77
|
-
|
78
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
79
|
-
# a real object. This is generally recommended.
|
80
|
-
mocks.verify_partial_doubles = true
|
81
|
-
end
|
82
|
-
=end
|
83
16
|
end
|
84
17
|
|
85
18
|
# Helper methods
|
86
19
|
RAILS_TEST_APP_DIR = "#{Dir.pwd}/spec/support/rails_test_app"
|
87
20
|
|
21
|
+
def execution_output(command)
|
22
|
+
stdout = Bundler.with_clean_env do
|
23
|
+
Open3.pipeline_r(
|
24
|
+
command
|
25
|
+
)
|
26
|
+
end
|
27
|
+
stdout.first.readlines
|
28
|
+
end
|
29
|
+
|
88
30
|
def clean(string)
|
89
31
|
string.split(/\n/).map(&:strip).join("\n")
|
90
32
|
end
|
@@ -98,7 +40,7 @@ def expected(code)
|
|
98
40
|
end
|
99
41
|
|
100
42
|
def exec_generation(generate_for)
|
101
|
-
|
43
|
+
_, stdout, stderr = Bundler.with_clean_env do
|
102
44
|
Open3.popen3(
|
103
45
|
"cd #{RAILS_TEST_APP_DIR} && bundle exec zapata generate #{generate_for} -s"
|
104
46
|
)
|
@@ -107,7 +49,7 @@ def exec_generation(generate_for)
|
|
107
49
|
output = stdout.readlines
|
108
50
|
begin
|
109
51
|
generated_filename = output.last.match(/File\ (.+)\ was/)[1]
|
110
|
-
rescue
|
52
|
+
rescue StandardError
|
111
53
|
raise "Did not get the message that file was generated. Got this instead:
|
112
54
|
STDOUT: #{output}
|
113
55
|
STDERR: #{stderr.readlines}"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class RobotToTest
|
2
|
-
def initialize(human_name,
|
2
|
+
def initialize(human_name, _cv)
|
3
3
|
@name = robot_name(human_name)
|
4
4
|
end
|
5
5
|
|
@@ -11,7 +11,7 @@ class RobotToTest
|
|
11
11
|
{ planets: planets }
|
12
12
|
end
|
13
13
|
|
14
|
-
def nested_fun_objects(
|
14
|
+
def nested_fun_objects(_fun_objects)
|
15
15
|
'It was fun'
|
16
16
|
end
|
17
17
|
|
@@ -26,7 +26,7 @@ class RobotToTest
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def fun_objects
|
29
|
-
[%i
|
29
|
+
[%i[array in array], { hash: nested_hash }]
|
30
30
|
end
|
31
31
|
|
32
32
|
def nested_hash
|
@@ -34,7 +34,7 @@ class RobotToTest
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def array
|
37
|
-
%w
|
37
|
+
%w[array]
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
describe RobotToTest do
|
4
4
|
let(:robot_to_test) do
|
5
|
-
RobotToTest.new('Emiliano',
|
5
|
+
RobotToTest.new('Emiliano', planets: ['Mars', Human.home])
|
6
6
|
end
|
7
7
|
|
8
8
|
it '#robot_name' do
|
@@ -10,7 +10,7 @@ describe RobotToTest do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it '#cv' do
|
13
|
-
expect(robot_to_test.cv).to eq(
|
13
|
+
expect(robot_to_test.cv).to eq(planets: %w(Mars Earth))
|
14
14
|
end
|
15
15
|
|
16
16
|
it '#nested_fun_objects' do
|
@@ -26,6 +26,6 @@ describe TestHash do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it '#test_keys_are_symbols' do
|
29
|
-
expect(test_hash.test_keys_are_symbols({ this: 'should', be: 'pretty' })).to eq({
|
29
|
+
expect(test_hash.test_keys_are_symbols({ this: 'should', be: 'pretty' })).to eq({ be: 'pretty', this: 'should' })
|
30
30
|
end
|
31
31
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV[
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
3
|
require 'spec_helper'
|
4
|
-
require File.expand_path(
|
4
|
+
require File.expand_path('../../config/environment', __FILE__)
|
5
5
|
require 'rspec/rails'
|
6
6
|
|
7
7
|
# Requires supporting ruby files with custom matchers and macros, etc, in
|
@@ -11,7 +11,7 @@ require 'rspec/rails'
|
|
11
11
|
# run twice. It is recommended that you do not name files matching this glob to
|
12
12
|
# end with _spec.rb. You can configure this pattern with the --pattern
|
13
13
|
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
14
|
-
Dir[Rails.root.join(
|
14
|
+
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
15
15
|
|
16
16
|
# Checks for pending migrations before tests are run.
|
17
17
|
# If you are not using ActiveRecord, you can remove this line.
|
@@ -15,64 +15,62 @@
|
|
15
15
|
#
|
16
16
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
17
|
RSpec.configure do |config|
|
18
|
-
# The settings below are suggested to provide a good initial experience
|
19
|
-
# with RSpec, but feel free to customize to your heart's content.
|
20
|
-
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
config.
|
26
|
-
|
27
|
-
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
|
42
|
-
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
|
48
|
-
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
#
|
66
|
-
#
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
end
|
77
|
-
=end
|
18
|
+
# The settings below are suggested to provide a good initial experience
|
19
|
+
# with RSpec, but feel free to customize to your heart's content.
|
20
|
+
# # These two settings work together to allow you to limit a spec run
|
21
|
+
# # to individual examples or groups you care about by tagging them with
|
22
|
+
# # `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
23
|
+
# # get run.
|
24
|
+
# config.filter_run :focus
|
25
|
+
# config.run_all_when_everything_filtered = true
|
26
|
+
#
|
27
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
28
|
+
# # file, and it's useful to allow more verbose output when running an
|
29
|
+
# # individual spec file.
|
30
|
+
# if config.files_to_run.one?
|
31
|
+
# # Use the documentation formatter for detailed output,
|
32
|
+
# # unless a formatter has already been configured
|
33
|
+
# # (e.g. via a command-line flag).
|
34
|
+
# config.default_formatter = 'doc'
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# # Print the 10 slowest examples and example groups at the
|
38
|
+
# # end of the spec run, to help surface which specs are running
|
39
|
+
# # particularly slow.
|
40
|
+
# config.profile_examples = 10
|
41
|
+
#
|
42
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
43
|
+
# # order dependency and want to debug it, you can fix the order by providing
|
44
|
+
# # the seed, which is printed after each run.
|
45
|
+
# # --seed 1234
|
46
|
+
# config.order = :random
|
47
|
+
#
|
48
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
49
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
50
|
+
# # test failures related to randomization by passing the same `--seed` value
|
51
|
+
# # as the one that triggered the failure.
|
52
|
+
# Kernel.srand config.seed
|
53
|
+
#
|
54
|
+
# # rspec-expectations config goes here. You can use an alternate
|
55
|
+
# # assertion/expectation library such as wrong or the stdlib/minitest
|
56
|
+
# # assertions if you prefer.
|
57
|
+
# config.expect_with :rspec do |expectations|
|
58
|
+
# # Enable only the newer, non-monkey-patching expect syntax.
|
59
|
+
# # For more details, see:
|
60
|
+
# # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
61
|
+
# expectations.syntax = :expect
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
# # rspec-mocks config goes here. You can use an alternate test double
|
65
|
+
# # library (such as bogus or mocha) by changing the `mock_with` option here.
|
66
|
+
# config.mock_with :rspec do |mocks|
|
67
|
+
# # Enable only the newer, non-monkey-patching expect syntax.
|
68
|
+
# # For more details, see:
|
69
|
+
# # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
70
|
+
# mocks.syntax = :expect
|
71
|
+
#
|
72
|
+
# # Prevents you from mocking or stubbing a method that does not exist on
|
73
|
+
# # a real object. This is generally recommended.
|
74
|
+
# mocks.verify_partial_doubles = true
|
75
|
+
# end
|
78
76
|
end
|