git-multirepo 1.0.0.beta40 → 1.0.0.beta42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +2 -2
- data/.gitbugtraq +3 -3
- data/.gitignore +38 -38
- data/.multirepo.meta +2 -2
- data/.rspec +2 -2
- data/Gemfile +4 -4
- data/Gemfile.lock +42 -42
- data/LICENSE +22 -22
- data/README.md +143 -146
- data/Rakefile +2 -2
- data/bin/multi +10 -10
- data/docs/bug-repros/91565510-repro.sh +20 -20
- data/docs/git-multirepo-cheatsheet.docx +0 -0
- data/git-multirepo.gemspec +31 -31
- data/lib/commands.rb +13 -15
- data/lib/git-multirepo.rb +2 -2
- data/lib/info.rb +4 -4
- data/lib/multirepo/commands/add-command.rb +50 -53
- data/lib/multirepo/commands/branch-command.rb +81 -82
- data/lib/multirepo/commands/checkout-command.rb +119 -122
- data/lib/multirepo/commands/clone-command.rb +67 -70
- data/lib/multirepo/commands/command.rb +89 -75
- data/lib/multirepo/commands/do-command.rb +100 -75
- data/lib/multirepo/commands/graph-command.rb +42 -45
- data/lib/multirepo/commands/init-command.rb +119 -119
- data/lib/multirepo/commands/install-command.rb +106 -103
- data/lib/multirepo/commands/merge-command.rb +225 -167
- data/lib/multirepo/commands/open-command.rb +55 -57
- data/lib/multirepo/commands/remove-command.rb +47 -50
- data/lib/multirepo/commands/uninit-command.rb +17 -20
- data/lib/multirepo/commands/update-command.rb +55 -60
- data/lib/multirepo/config.rb +15 -15
- data/lib/multirepo/files/config-entry.rb +38 -38
- data/lib/multirepo/files/config-file.rb +45 -45
- data/lib/multirepo/files/lock-entry.rb +28 -24
- data/lib/multirepo/files/lock-file.rb +55 -38
- data/lib/multirepo/files/meta-file.rb +40 -40
- data/lib/multirepo/files/tracking-file.rb +8 -8
- data/lib/multirepo/files/tracking-files.rb +46 -46
- data/lib/multirepo/git/branch.rb +31 -30
- data/lib/multirepo/git/change.rb +10 -10
- data/lib/multirepo/git/commit.rb +6 -17
- data/lib/multirepo/git/git-runner.rb +46 -46
- data/lib/multirepo/git/git.rb +10 -0
- data/lib/multirepo/git/ref.rb +38 -0
- data/lib/multirepo/git/remote.rb +16 -16
- data/lib/multirepo/git/repo.rb +122 -77
- data/lib/multirepo/hooks/post-commit-hook.rb +22 -22
- data/lib/multirepo/hooks/pre-commit-hook.rb +34 -31
- data/lib/multirepo/logic/dependency.rb +6 -0
- data/lib/multirepo/logic/merge-descriptor.rb +94 -12
- data/lib/multirepo/logic/node.rb +71 -44
- data/lib/multirepo/logic/performer.rb +56 -62
- data/lib/multirepo/logic/revision-selector.rb +34 -34
- data/lib/multirepo/multirepo-exception.rb +5 -5
- data/lib/multirepo/utility/console.rb +51 -51
- data/lib/multirepo/utility/runner.rb +34 -34
- data/lib/multirepo/utility/utils.rb +94 -81
- data/resources/.gitconfig +2 -2
- data/resources/post-commit +5 -5
- data/resources/pre-commit +5 -5
- data/spec/integration/init_spec.rb +18 -18
- data/spec/spec_helper.rb +89 -89
- metadata +6 -5
- data/lib/multirepo/commands/clean-command.rb +0 -32
- data/lib/multirepo/commands/fetch-command.rb +0 -31
@@ -1,6 +1,6 @@
|
|
1
|
-
require "claide/informative_error"
|
2
|
-
|
3
|
-
module MultiRepo
|
4
|
-
class MultiRepoException < StandardError
|
5
|
-
end
|
1
|
+
require "claide/informative_error"
|
2
|
+
|
3
|
+
module MultiRepo
|
4
|
+
class MultiRepoException < StandardError
|
5
|
+
end
|
6
6
|
end
|
@@ -1,52 +1,52 @@
|
|
1
|
-
require "colored"
|
2
|
-
|
3
|
-
module MultiRepo
|
4
|
-
class Console
|
5
|
-
def self.log_step(message)
|
6
|
-
print_prefix
|
7
|
-
puts $stdout.isatty ? message.bold.green : message
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.log_substep(message)
|
11
|
-
print_prefix
|
12
|
-
puts $stdout.isatty ? message.blue : message
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.log_info(message)
|
16
|
-
print_prefix
|
17
|
-
puts $stdout.isatty ? message.white : message
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.log_warning(message)
|
21
|
-
print_prefix
|
22
|
-
puts $stdout.isatty ? message.yellow : message
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.log_error(message)
|
26
|
-
print_prefix
|
27
|
-
puts $stdout.isatty ? message.red : message
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.ask_yes_no(message)
|
31
|
-
answered = false
|
32
|
-
while !answered
|
33
|
-
print_prefix
|
34
|
-
print message
|
35
|
-
print " (y/n) "
|
36
|
-
|
37
|
-
case $stdin.gets.strip.downcase
|
38
|
-
when "y", "yes"
|
39
|
-
answered = true
|
40
|
-
return true
|
41
|
-
when "n", "no"
|
42
|
-
answered = true
|
43
|
-
return false
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.print_prefix
|
49
|
-
print $stdout.isatty ? "> ".white : "[multirepo] "
|
50
|
-
end
|
51
|
-
end
|
1
|
+
require "colored"
|
2
|
+
|
3
|
+
module MultiRepo
|
4
|
+
class Console
|
5
|
+
def self.log_step(message)
|
6
|
+
print_prefix
|
7
|
+
puts $stdout.isatty ? message.bold.green : message
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.log_substep(message)
|
11
|
+
print_prefix
|
12
|
+
puts $stdout.isatty ? message.blue : message
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.log_info(message)
|
16
|
+
print_prefix
|
17
|
+
puts $stdout.isatty ? message.white : message
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.log_warning(message)
|
21
|
+
print_prefix
|
22
|
+
puts $stdout.isatty ? message.yellow : message
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.log_error(message)
|
26
|
+
print_prefix
|
27
|
+
puts $stdout.isatty ? message.red : message
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.ask_yes_no(message)
|
31
|
+
answered = false
|
32
|
+
while !answered
|
33
|
+
print_prefix
|
34
|
+
print message
|
35
|
+
print " (y/n) "
|
36
|
+
|
37
|
+
case $stdin.gets.strip.downcase
|
38
|
+
when "y", "yes"
|
39
|
+
answered = true
|
40
|
+
return true
|
41
|
+
when "n", "no"
|
42
|
+
answered = true
|
43
|
+
return false
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.print_prefix
|
49
|
+
print $stdout.isatty ? "> ".white : "[multirepo] "
|
50
|
+
end
|
51
|
+
end
|
52
52
|
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
require "open3"
|
2
|
-
require "multirepo/utility/console"
|
3
|
-
|
4
|
-
module MultiRepo
|
5
|
-
class Runner
|
6
|
-
class Verbosity
|
7
|
-
OUTPUT_NEVER = 0
|
8
|
-
OUTPUT_ALWAYS = 1
|
9
|
-
OUTPUT_ON_ERROR = 2
|
10
|
-
end
|
11
|
-
|
12
|
-
class << self
|
13
|
-
attr_accessor :last_command_succeeded
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.run(cmd, verbosity)
|
17
|
-
Console.log_info("Command: #{cmd}") if Config.instance.verbose
|
18
|
-
|
19
|
-
lines = []
|
20
|
-
Open3.popen2e(cmd) do |stdin, stdout_and_stderr, thread|
|
21
|
-
stdout_and_stderr.each do |line|
|
22
|
-
Console.log_info("#{line.rstrip}") if verbosity == Verbosity::OUTPUT_ALWAYS || Config.instance.verbose
|
23
|
-
lines << line
|
24
|
-
end
|
25
|
-
@last_command_succeeded = thread.value.success?
|
26
|
-
end
|
27
|
-
|
28
|
-
output = lines.join("").rstrip
|
29
|
-
|
30
|
-
Console.log_error(output) if !@last_command_succeeded && verbosity == Verbosity::OUTPUT_ON_ERROR
|
31
|
-
|
32
|
-
return output
|
33
|
-
end
|
34
|
-
end
|
1
|
+
require "open3"
|
2
|
+
require "multirepo/utility/console"
|
3
|
+
|
4
|
+
module MultiRepo
|
5
|
+
class Runner
|
6
|
+
class Verbosity
|
7
|
+
OUTPUT_NEVER = 0
|
8
|
+
OUTPUT_ALWAYS = 1
|
9
|
+
OUTPUT_ON_ERROR = 2
|
10
|
+
end
|
11
|
+
|
12
|
+
class << self
|
13
|
+
attr_accessor :last_command_succeeded
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.run(cmd, verbosity)
|
17
|
+
Console.log_info("Command: #{cmd}") if Config.instance.verbose
|
18
|
+
|
19
|
+
lines = []
|
20
|
+
Open3.popen2e(cmd) do |stdin, stdout_and_stderr, thread|
|
21
|
+
stdout_and_stderr.each do |line|
|
22
|
+
Console.log_info("#{line.rstrip}") if verbosity == Verbosity::OUTPUT_ALWAYS || Config.instance.verbose
|
23
|
+
lines << line
|
24
|
+
end
|
25
|
+
@last_command_succeeded = thread.value.success?
|
26
|
+
end
|
27
|
+
|
28
|
+
output = lines.join("").rstrip
|
29
|
+
|
30
|
+
Console.log_error(output) if !@last_command_succeeded && verbosity == Verbosity::OUTPUT_ON_ERROR
|
31
|
+
|
32
|
+
return output
|
33
|
+
end
|
34
|
+
end
|
35
35
|
end
|
@@ -1,82 +1,95 @@
|
|
1
|
-
require "
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
FileUtils.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
sibling_repos.
|
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
|
-
end
|
64
|
-
|
65
|
-
def self.
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
1
|
+
require "multirepo/multirepo-exception"
|
2
|
+
require "fileutils"
|
3
|
+
|
4
|
+
module MultiRepo
|
5
|
+
class Utils
|
6
|
+
def self.path_for_resource(resource_name)
|
7
|
+
gem_path = Gem::Specification.find_by_name("git-multirepo").gem_dir
|
8
|
+
File.join(gem_path, "resources/#{resource_name}")
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.is_multirepo_enabled(path)
|
12
|
+
File.exists?(File.join(path, ".multirepo"))
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.is_multirepo_tracked(path)
|
16
|
+
is_multirepo_enabled(path) && File.exists?(File.join(path, ".multirepo.lock"))
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.install_hook(name, path)
|
20
|
+
destination_path = File.join(path, ".git/hooks")
|
21
|
+
destination_file = File.join(destination_path, name)
|
22
|
+
FileUtils.cp(path_for_resource(name), destination_file)
|
23
|
+
FileUtils.chmod(0755, destination_file) # -rwxr-xr-x
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.sibling_repos
|
27
|
+
sibling_directories = Dir['../*/']
|
28
|
+
sibling_repos = sibling_directories.map{ |d| Repo.new(d) }.select{ |r| r.exists? }
|
29
|
+
sibling_repos.delete_if{ |r| Pathname.new(r.path).realpath == Pathname.new(".").realpath }
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.dependencies_clean?(config_entries)
|
33
|
+
clean = true
|
34
|
+
missing = false
|
35
|
+
config_entries.each do |e|
|
36
|
+
# Ensure the dependency exists
|
37
|
+
unless e.repo.exists?
|
38
|
+
Console.log_error("Dependency '#{e.path}' does not exist on disk")
|
39
|
+
missing |= true
|
40
|
+
next
|
41
|
+
end
|
42
|
+
|
43
|
+
# Ensure it contains no uncommitted changes
|
44
|
+
dependency_clean = e.repo.clean?
|
45
|
+
clean &= dependency_clean
|
46
|
+
Console.log_warning("Dependency '#{e.repo.path}' contains uncommitted changes") unless dependency_clean
|
47
|
+
end
|
48
|
+
|
49
|
+
raise MultiRepoException, "Some dependencies are not present on this machine." +
|
50
|
+
" Run \"multi install\" to clone missing dependencies." if missing
|
51
|
+
|
52
|
+
return clean
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.ensure_working_copies_clean(repos)
|
56
|
+
clean = true
|
57
|
+
repos.each do |repo|
|
58
|
+
dependency_clean = repo.clean?
|
59
|
+
clean &= dependency_clean
|
60
|
+
Console.log_warning("Repo '#{repo.path}' contains uncommitted changes") unless dependency_clean
|
61
|
+
end
|
62
|
+
return clean
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.convert_to_windows_path(unix_path)
|
66
|
+
components = Pathname.new(unix_path).each_filename.to_a
|
67
|
+
components.join(File::ALT_SEPARATOR)
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.reveal_in_default_file_browser(unix_path)
|
71
|
+
if OS.osx?
|
72
|
+
system %{open "#{unix_path}"}
|
73
|
+
elsif OS.windows?
|
74
|
+
system %{explorer "#{Utils.convert_to_windows_path(unix_path)}"}
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.open_in_default_app(unix_path)
|
79
|
+
if OS.osx?
|
80
|
+
system %{open "#{unix_path}"}
|
81
|
+
elsif OS.windows?
|
82
|
+
system %{cmd /c "start C:\\#{Utils.convert_to_windows_path(unix_path)}"}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.append_if_missing(path, pattern, string_to_append)
|
87
|
+
unless File.exists?(path)
|
88
|
+
File.open(path, 'w') { |f| f.puts(string_to_append) }
|
89
|
+
else
|
90
|
+
string_located = File.readlines(path).grep(pattern).any?
|
91
|
+
File.open(path, 'a') { |f| f.puts(string_to_append) } unless string_located
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
82
95
|
end
|
data/resources/.gitconfig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
[merge "ours"]
|
2
|
-
name = "Always keep ours"
|
1
|
+
[merge "ours"]
|
2
|
+
name = "Always keep ours"
|
3
3
|
driver = true
|
data/resources/post-commit
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "rubygems"
|
4
|
-
require "git-multirepo"
|
5
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "git-multirepo"
|
5
|
+
|
6
6
|
MultiRepo::PostCommitHook.run
|
data/resources/pre-commit
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "rubygems"
|
4
|
-
require "git-multirepo"
|
5
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "git-multirepo"
|
5
|
+
|
6
6
|
MultiRepo::PreCommitHook.run
|
@@ -1,19 +1,19 @@
|
|
1
|
-
require "multirepo/commands/init"
|
2
|
-
|
3
|
-
RSpec.describe("Init") do
|
4
|
-
it "creates the config file" do
|
5
|
-
pending
|
6
|
-
end
|
7
|
-
|
8
|
-
it "adds only specified repos to the config file" do
|
9
|
-
pending
|
10
|
-
end
|
11
|
-
|
12
|
-
it "installs the hooks" do
|
13
|
-
pending
|
14
|
-
end
|
15
|
-
|
16
|
-
it "fails when there are uncommitted changes in dependencies" do
|
17
|
-
pending
|
18
|
-
end
|
1
|
+
require "multirepo/commands/init"
|
2
|
+
|
3
|
+
RSpec.describe("Init") do
|
4
|
+
it "creates the config file" do
|
5
|
+
pending
|
6
|
+
end
|
7
|
+
|
8
|
+
it "adds only specified repos to the config file" do
|
9
|
+
pending
|
10
|
+
end
|
11
|
+
|
12
|
+
it "installs the hooks" do
|
13
|
+
pending
|
14
|
+
end
|
15
|
+
|
16
|
+
it "fails when there are uncommitted changes in dependencies" do
|
17
|
+
pending
|
18
|
+
end
|
19
19
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,89 +1,89 @@
|
|
1
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
-
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
-
#
|
6
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
-
# a separate helper file that requires the additional dependencies and performs
|
11
|
-
# the additional setup, and require it from the spec files that actually need it.
|
12
|
-
#
|
13
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
-
# users commonly want.
|
15
|
-
#
|
16
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
-
RSpec.configure do |config|
|
18
|
-
# rspec-expectations config goes here. You can use an alternate
|
19
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
-
# assertions if you prefer.
|
21
|
-
config.expect_with :rspec do |expectations|
|
22
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
-
# and `failure_message` of custom matchers include text for helper methods
|
24
|
-
# defined using `chain`, e.g.:
|
25
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
-
# # => "be bigger than 2 and smaller than 4"
|
27
|
-
# ...rather than:
|
28
|
-
# # => "be bigger than 2"
|
29
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
-
end
|
31
|
-
|
32
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
-
config.mock_with :rspec do |mocks|
|
35
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
-
# a real object. This is generally recommended, and will default to
|
37
|
-
# `true` in RSpec 4.
|
38
|
-
mocks.verify_partial_doubles = true
|
39
|
-
end
|
40
|
-
|
41
|
-
# The settings below are suggested to provide a good initial experience
|
42
|
-
# with RSpec, but feel free to customize to your heart's content.
|
43
|
-
=begin
|
44
|
-
# These two settings work together to allow you to limit a spec run
|
45
|
-
# to individual examples or groups you care about by tagging them with
|
46
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
-
# get run.
|
48
|
-
config.filter_run :focus
|
49
|
-
config.run_all_when_everything_filtered = true
|
50
|
-
|
51
|
-
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
-
# For more details, see:
|
53
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
-
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
-
config.disable_monkey_patching!
|
57
|
-
|
58
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
59
|
-
# be too noisy due to issues in dependencies.
|
60
|
-
config.warnings = true
|
61
|
-
|
62
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
63
|
-
# file, and it's useful to allow more verbose output when running an
|
64
|
-
# individual spec file.
|
65
|
-
if config.files_to_run.one?
|
66
|
-
# Use the documentation formatter for detailed output,
|
67
|
-
# unless a formatter has already been configured
|
68
|
-
# (e.g. via a command-line flag).
|
69
|
-
config.default_formatter = 'doc'
|
70
|
-
end
|
71
|
-
|
72
|
-
# Print the 10 slowest examples and example groups at the
|
73
|
-
# end of the spec run, to help surface which specs are running
|
74
|
-
# particularly slow.
|
75
|
-
config.profile_examples = 10
|
76
|
-
|
77
|
-
# Run specs in random order to surface order dependencies. If you find an
|
78
|
-
# order dependency and want to debug it, you can fix the order by providing
|
79
|
-
# the seed, which is printed after each run.
|
80
|
-
# --seed 1234
|
81
|
-
config.order = :random
|
82
|
-
|
83
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
84
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
85
|
-
# test failures related to randomization by passing the same `--seed` value
|
86
|
-
# as the one that triggered the failure.
|
87
|
-
Kernel.srand config.seed
|
88
|
-
=end
|
89
|
-
end
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
50
|
+
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
57
|
+
|
58
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
59
|
+
# be too noisy due to issues in dependencies.
|
60
|
+
config.warnings = true
|
61
|
+
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
63
|
+
# file, and it's useful to allow more verbose output when running an
|
64
|
+
# individual spec file.
|
65
|
+
if config.files_to_run.one?
|
66
|
+
# Use the documentation formatter for detailed output,
|
67
|
+
# unless a formatter has already been configured
|
68
|
+
# (e.g. via a command-line flag).
|
69
|
+
config.default_formatter = 'doc'
|
70
|
+
end
|
71
|
+
|
72
|
+
# Print the 10 slowest examples and example groups at the
|
73
|
+
# end of the spec run, to help surface which specs are running
|
74
|
+
# particularly slow.
|
75
|
+
config.profile_examples = 10
|
76
|
+
|
77
|
+
# Run specs in random order to surface order dependencies. If you find an
|
78
|
+
# order dependency and want to debug it, you can fix the order by providing
|
79
|
+
# the seed, which is printed after each run.
|
80
|
+
# --seed 1234
|
81
|
+
config.order = :random
|
82
|
+
|
83
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
84
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
85
|
+
# test failures related to randomization by passing the same `--seed` value
|
86
|
+
# as the one that triggered the failure.
|
87
|
+
Kernel.srand config.seed
|
88
|
+
=end
|
89
|
+
end
|