ehbrs-tools 0.16.2 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ehbrs/cooking_book.rb +9 -0
- data/lib/ehbrs/cooking_book/build.rb +45 -0
- data/lib/ehbrs/cooking_book/build/base_page.rb +43 -0
- data/lib/ehbrs/cooking_book/build/index_page.rb +26 -0
- data/lib/ehbrs/cooking_book/build/recipe_page.rb +27 -0
- data/lib/ehbrs/cooking_book/project.rb +25 -0
- data/lib/ehbrs/cooking_book/recipe.rb +37 -0
- data/lib/ehbrs/cooking_book/recipe/ingredient.rb +21 -0
- data/lib/ehbrs/cooking_book/recipe/measure.rb +60 -0
- data/lib/ehbrs/cooking_book/recipe/part.rb +32 -0
- data/lib/ehbrs/patches/module/erb_template.rb +11 -0
- data/lib/ehbrs/patches/object/erb_template.rb +9 -0
- data/lib/ehbrs/patches/object/template.rb +7 -0
- data/lib/ehbrs/runner.rb +6 -13
- data/lib/ehbrs/runner/cooking_book.rb +30 -0
- data/lib/ehbrs/runner/cooking_book/build.rb +32 -0
- data/lib/ehbrs/runner/telegram.rb +26 -0
- data/lib/ehbrs/runner/telegram/send_message.rb +29 -0
- data/lib/ehbrs/telegram.rb +9 -0
- data/lib/ehbrs/telegram/message_sending.rb +32 -0
- data/lib/ehbrs/tools/application.rb +13 -0
- data/lib/ehbrs/tools/instance.rb +16 -0
- data/lib/ehbrs/tools/version.rb +1 -1
- data/lib/ehbrs/videos/track.rb +1 -19
- data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +1 -1
- data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +1 -1
- data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +2 -2
- data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +1 -1
- data/lib/ehbrs/videos/unsupported/fix_profile.rb +0 -13
- data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +10 -10
- data/template/ehbrs/cooking_book/build/base_page/layout.html.erb +20 -0
- data/template/ehbrs/cooking_book/build/index_page/inner.html.erb +6 -0
- data/template/ehbrs/cooking_book/build/recipe_page/inner.html.erb +6 -0
- data/template/ehbrs/cooking_book/build/recipe_page/part.html.erb +27 -0
- data/vendor/eac_cli/eac_cli.gemspec +1 -1
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_context_replacement.rb +15 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +5 -0
- data/vendor/eac_cli/lib/eac_cli/parser.rb +6 -4
- data/vendor/eac_cli/lib/eac_cli/parser/alternative.rb +8 -4
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/options.rb +7 -36
- data/vendor/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +45 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +10 -2
- data/vendor/eac_cli/lib/eac_cli/runner/exit.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +17 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/subcommands.rb +19 -2
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +28 -4
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +42 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +29 -1
- data/vendor/eac_docker/lib/eac_docker/container.rb +24 -0
- data/vendor/eac_docker/lib/eac_docker/images/coded.rb +39 -0
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +26 -0
- data/vendor/eac_docker/lib/eac_docker/registry.rb +17 -0
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +12 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +17 -0
- data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -0
- data/vendor/eac_ruby_base0/Gemfile +5 -0
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +20 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0.rb +7 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +69 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +54 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +22 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +7 -0
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +100 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +2 -50
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb +52 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +41 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +6 -50
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +29 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +53 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +54 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +10 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +4 -6
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb +33 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +24 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +0 -21
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/traverser.rb +0 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +4 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +38 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +8 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/template.rb +10 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/template.rb +1 -8
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +2 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +7 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +8 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +40 -17
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +96 -8
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +2 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +12 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/videos/stream.rb +1 -1
- metadata +101 -9
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb +0 -25
@@ -8,6 +8,7 @@ module EacDocker
|
|
8
8
|
immutable_accessor :interactive, :temporary, :tty, type: :boolean
|
9
9
|
immutable_accessor :env, type: :hash
|
10
10
|
immutable_accessor :command_arg, :volume, type: :array
|
11
|
+
attr_reader :id
|
11
12
|
common_constructor :image
|
12
13
|
|
13
14
|
def immutable_constructor_args
|
@@ -16,6 +17,23 @@ module EacDocker
|
|
16
17
|
|
17
18
|
alias immutable_volume volume
|
18
19
|
|
20
|
+
def hostname
|
21
|
+
::EacDocker::Executables.docker.command(
|
22
|
+
'inspect', '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}',
|
23
|
+
id
|
24
|
+
).execute!.strip
|
25
|
+
end
|
26
|
+
|
27
|
+
def on_detached
|
28
|
+
command = ::EacDocker::Executables.docker.command(*(%w[run --detach] + run_command_args))
|
29
|
+
self.id = command.execute!.strip
|
30
|
+
begin
|
31
|
+
yield(self)
|
32
|
+
ensure
|
33
|
+
stop
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
19
37
|
def volume(left_part, right_part = null)
|
20
38
|
immutable_volume(right_part.if_present(left_part) { |v| "#{left_part}:#{v}" })
|
21
39
|
end
|
@@ -29,8 +47,14 @@ module EacDocker
|
|
29
47
|
command_args
|
30
48
|
end
|
31
49
|
|
50
|
+
def stop
|
51
|
+
::EacDocker::Executables.docker.command('stop', id).execute!
|
52
|
+
end
|
53
|
+
|
32
54
|
private
|
33
55
|
|
56
|
+
attr_writer :id
|
57
|
+
|
34
58
|
def run_command_boolean_args
|
35
59
|
r = []
|
36
60
|
r << '--interactive' if interactive?
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_docker/executables'
|
4
|
+
require 'eac_docker/images/base'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module EacDocker
|
8
|
+
module Images
|
9
|
+
class Coded < ::EacDocker::Images::Base
|
10
|
+
enable_simple_cache
|
11
|
+
enable_immutable
|
12
|
+
immutable_accessor :tag
|
13
|
+
common_constructor :path do
|
14
|
+
self.path = path.to_pathname
|
15
|
+
end
|
16
|
+
|
17
|
+
def immutable_constructor_args
|
18
|
+
[path]
|
19
|
+
end
|
20
|
+
|
21
|
+
def provide
|
22
|
+
id
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def id_uncached
|
29
|
+
::EacDocker::Executables.docker.command(*build_args).execute!.strip
|
30
|
+
end
|
31
|
+
|
32
|
+
def build_args
|
33
|
+
args = %w[build --quiet]
|
34
|
+
args += ['--tag', tag] if tag.present?
|
35
|
+
args + [path.to_path]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_docker/images/base'
|
4
|
+
require 'eac_docker/images/coded'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
require 'eac_ruby_utils/fs/temp'
|
7
|
+
|
8
|
+
module EacDocker
|
9
|
+
module Images
|
10
|
+
class Templatized < ::EacDocker::Images::Base
|
11
|
+
enable_immutable
|
12
|
+
immutable_accessor :tag
|
13
|
+
|
14
|
+
def provide
|
15
|
+
::EacRubyUtils::Fs::Temp.on_directory do |provide_dir|
|
16
|
+
template.apply(self, provide_dir)
|
17
|
+
coded_image(provide_dir).tag(tag).provide
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def coded_image(provide_dir)
|
22
|
+
::EacDocker::Images::Coded.new(provide_dir)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_docker/images/coded'
|
4
|
+
|
5
|
+
RSpec.describe(::EacDocker::Images::Coded, docker: true) do
|
6
|
+
let(:fixtures_dir) { ::Pathname.new('coded_spec_files').expand_path(__dir__) }
|
7
|
+
let(:instance) { described_class.new(fixtures_dir / 'image1') }
|
8
|
+
|
9
|
+
describe '#provide' do
|
10
|
+
it { expect { instance.provide }.not_to raise_error }
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
from ubuntu:bionic
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_docker/images/templatized'
|
4
|
+
|
5
|
+
RSpec.describe(::EacDocker::Images::Templatized, docker: true) do
|
6
|
+
let(:fixtures_dir) { ::Pathname.new('templatized_spec_files').expand_path(__dir__) }
|
7
|
+
let(:instance) { StubDockerImage.new }
|
8
|
+
|
9
|
+
before do
|
10
|
+
::EacRubyUtils::Templates::Searcher.default.included_paths << fixtures_dir
|
11
|
+
stub_const('StubDockerImage', Class.new(described_class))
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#provide' do
|
15
|
+
it { expect { instance.provide }.not_to raise_error }
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
from ubuntu:bionic
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'eac_ruby_base0/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'eac_ruby_base0'
|
9
|
+
s.version = EacRubyBase0::VERSION
|
10
|
+
s.authors = ['Put here the authors']
|
11
|
+
s.summary = 'Put here de description.'
|
12
|
+
|
13
|
+
s.files = Dir['{lib}/**/*']
|
14
|
+
|
15
|
+
s.add_dependency 'eac_cli', '~> 0.7'
|
16
|
+
s.add_dependency 'eac_ruby_gems_utils', '~> 0.7', '>= 0.7.2'
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.46'
|
18
|
+
|
19
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.2'
|
20
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_gems_utils/gem'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'eac_ruby_utils/filesystem_cache'
|
6
|
+
|
7
|
+
module EacRubyBase0
|
8
|
+
class Application
|
9
|
+
enable_simple_cache
|
10
|
+
enable_listable
|
11
|
+
lists.add_symbol :option, :name, :home_dir
|
12
|
+
|
13
|
+
common_constructor :gemspec_dir, :options, default: [{}] do
|
14
|
+
self.gemspec_dir = gemspec_dir.to_pathname
|
15
|
+
self.options = options.symbolize_keys.assert_valid_keys(self.class.lists.option.values).freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
delegate :version, to: :self_gem
|
19
|
+
|
20
|
+
def all_gems
|
21
|
+
vendor_gems + [self_gem]
|
22
|
+
end
|
23
|
+
|
24
|
+
{ cache: '.cache', config: '.config', data: '.local/share' }.each do |item, subpath|
|
25
|
+
xdg_env_method_name = "#{item}_xdg_env"
|
26
|
+
|
27
|
+
define_method xdg_env_method_name do
|
28
|
+
ENV["XDG_#{item.upcase}_HOME"].if_present(&:to_pathname)
|
29
|
+
end
|
30
|
+
|
31
|
+
define_method "#{item}_dir" do
|
32
|
+
(send(xdg_env_method_name) || home_dir.join(subpath)).join(name)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def fs_cache
|
37
|
+
@fs_cache ||= ::EacRubyUtils::FilesystemCache.new(
|
38
|
+
cache_dir.join(::EacRubyUtils::FilesystemCache.name.parameterize)
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def home_dir
|
43
|
+
@home_dir ||= (options[OPTION_HOME_DIR] || ENV.fetch('HOME')).to_pathname
|
44
|
+
end
|
45
|
+
|
46
|
+
def name
|
47
|
+
options[OPTION_NAME] || self_gem.name
|
48
|
+
end
|
49
|
+
|
50
|
+
def vendor_dir
|
51
|
+
gemspec_dir.join('vendor')
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def self_gem_uncached
|
57
|
+
::EacRubyGemsUtils::Gem.new(gemspec_dir)
|
58
|
+
end
|
59
|
+
|
60
|
+
def vendor_gems_uncached
|
61
|
+
r = []
|
62
|
+
vendor_dir.children.each do |c|
|
63
|
+
vgem = ::EacRubyGemsUtils::Gem.new(c)
|
64
|
+
r << vgem if vgem.gemfile_path.exist?
|
65
|
+
end
|
66
|
+
r
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/runner_with/help'
|
4
|
+
require 'eac_cli/runner_with/subcommands'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module EacRubyBase0
|
8
|
+
module Runner
|
9
|
+
require_sub __FILE__
|
10
|
+
enable_console_speaker
|
11
|
+
common_concern do
|
12
|
+
include ::EacCli::RunnerWith::Help
|
13
|
+
include ::EacCli::RunnerWith::Subcommands
|
14
|
+
runner_definition do
|
15
|
+
bool_opt '-q', '--quiet', 'Quiet mode.'
|
16
|
+
bool_opt '-I', '--no-input', 'Fail if a input is requested.'
|
17
|
+
subcommands
|
18
|
+
alt do
|
19
|
+
bool_opt '-V', '--version', 'Show version.', usage: true, required: true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
on_speaker_node do |node|
|
26
|
+
node.stderr = ::StringIO.new if parsed.quiet?
|
27
|
+
node.stdin = FailIfRequestInput.new if parsed.no_input?
|
28
|
+
if parsed.version?
|
29
|
+
show_version
|
30
|
+
else
|
31
|
+
run_with_subcommand
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def application_version
|
37
|
+
runner_context.call(:application).version.to_s
|
38
|
+
end
|
39
|
+
|
40
|
+
def show_version
|
41
|
+
out("#{application_version}\n")
|
42
|
+
end
|
43
|
+
|
44
|
+
class FailIfRequestInput
|
45
|
+
enable_console_speaker
|
46
|
+
|
47
|
+
%w[gets noecho].each do |method|
|
48
|
+
define_method(method) do
|
49
|
+
raise "Input method requested (\"#{method}\") and option --no-input is set"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/core_ext'
|
4
|
+
require 'eac_ruby_gems_utils/tests/multiple'
|
5
|
+
|
6
|
+
module EacRubyBase0
|
7
|
+
module Runner
|
8
|
+
class TestAll
|
9
|
+
runner_with :help do
|
10
|
+
desc 'Test core and local gems.'
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
fatal_error 'Some test did not pass' unless tests.ok?
|
15
|
+
end
|
16
|
+
|
17
|
+
def tests_uncached
|
18
|
+
::EacRubyGemsUtils::Tests::Multiple.new(runner_context.call(:application).all_gems)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
6
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
7
|
+
# files.
|
8
|
+
#
|
9
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
10
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
11
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
12
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
13
|
+
# a separate helper file that requires the additional dependencies and performs
|
14
|
+
# the additional setup, and require it from the spec files that actually need
|
15
|
+
# it.
|
16
|
+
#
|
17
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
18
|
+
RSpec.configure do |config|
|
19
|
+
# rspec-expectations config goes here. You can use an alternate
|
20
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
21
|
+
# assertions if you prefer.
|
22
|
+
config.expect_with :rspec do |expectations|
|
23
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
24
|
+
# and `failure_message` of custom matchers include text for helper methods
|
25
|
+
# defined using `chain`, e.g.:
|
26
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
27
|
+
# # => "be bigger than 2 and smaller than 4"
|
28
|
+
# ...rather than:
|
29
|
+
# # => "be bigger than 2"
|
30
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
31
|
+
end
|
32
|
+
|
33
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
34
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
35
|
+
config.mock_with :rspec do |mocks|
|
36
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
37
|
+
# a real object. This is generally recommended, and will default to
|
38
|
+
# `true` in RSpec 4.
|
39
|
+
mocks.verify_partial_doubles = true
|
40
|
+
end
|
41
|
+
|
42
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
43
|
+
# have no way to turn it off -- the option exists only for backwards
|
44
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
45
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
46
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
47
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
48
|
+
|
49
|
+
# The settings below are suggested to provide a good initial experience
|
50
|
+
# with RSpec, but feel free to customize to your heart's content.
|
51
|
+
# # This allows you to limit a spec run to individual examples or groups
|
52
|
+
# # you care about by tagging them with `:focus` metadata. When nothing
|
53
|
+
# # is tagged with `:focus`, all examples get run. RSpec also provides
|
54
|
+
# # aliases for `it`, `describe`, and `context` that include `:focus`
|
55
|
+
# # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
56
|
+
# config.filter_run_when_matching :focus
|
57
|
+
#
|
58
|
+
# # Allows RSpec to persist some state between runs in order to support
|
59
|
+
# # the `--only-failures` and `--next-failure` CLI options. We recommend
|
60
|
+
# # you configure your source control system to ignore this file.
|
61
|
+
# config.example_status_persistence_file_path = "spec/examples.txt"
|
62
|
+
#
|
63
|
+
# # Limits the available syntax to the non-monkey patched syntax that is
|
64
|
+
# # recommended. For more details, see:
|
65
|
+
# # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
66
|
+
# # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
67
|
+
# # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
68
|
+
# config.disable_monkey_patching!
|
69
|
+
#
|
70
|
+
# # This setting enables warnings. It's recommended, but in some cases may
|
71
|
+
# # be too noisy due to issues in dependencies.
|
72
|
+
# config.warnings = true
|
73
|
+
#
|
74
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
75
|
+
# # file, and it's useful to allow more verbose output when running an
|
76
|
+
# # individual spec file.
|
77
|
+
# if config.files_to_run.one?
|
78
|
+
# # Use the documentation formatter for detailed output,
|
79
|
+
# # unless a formatter has already been configured
|
80
|
+
# # (e.g. via a command-line flag).
|
81
|
+
# config.default_formatter = "doc"
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# # Print the 10 slowest examples and example groups at the
|
85
|
+
# # end of the spec run, to help surface which specs are running
|
86
|
+
# # particularly slow.
|
87
|
+
# config.profile_examples = 10
|
88
|
+
#
|
89
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
90
|
+
# # order dependency and want to debug it, you can fix the order by providing
|
91
|
+
# # the seed, which is printed after each run.
|
92
|
+
# # --seed 1234
|
93
|
+
# config.order = :random
|
94
|
+
#
|
95
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
96
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
97
|
+
# # test failures related to randomization by passing the same `--seed` value
|
98
|
+
# # as the one that triggered the failure.
|
99
|
+
# Kernel.srand config.seed
|
100
|
+
end
|