rspec-core 3.0.0.beta2 → 3.0.0.rc1
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.yardopts +1 -0
- data/Changelog.md +297 -57
- data/README.md +16 -13
- data/lib/rspec/core.rb +55 -84
- data/lib/rspec/core/backport_random.rb +35 -3
- data/lib/rspec/core/backtrace_formatter.rb +4 -13
- data/lib/rspec/core/configuration.rb +330 -114
- data/lib/rspec/core/configuration_options.rb +38 -22
- data/lib/rspec/core/drb.rb +111 -0
- data/lib/rspec/core/dsl.rb +8 -2
- data/lib/rspec/core/example.rb +203 -94
- data/lib/rspec/core/example_group.rb +344 -316
- data/lib/rspec/core/filter_manager.rb +135 -90
- data/lib/rspec/core/flat_map.rb +1 -0
- data/lib/rspec/core/formatters.rb +50 -14
- data/lib/rspec/core/formatters/base_formatter.rb +32 -138
- data/lib/rspec/core/formatters/base_text_formatter.rb +32 -253
- data/lib/rspec/core/formatters/console_codes.rb +65 -0
- data/lib/rspec/core/formatters/deprecation_formatter.rb +24 -15
- data/lib/rspec/core/formatters/documentation_formatter.rb +7 -10
- data/lib/rspec/core/formatters/helpers.rb +15 -9
- data/lib/rspec/core/formatters/html_formatter.rb +17 -16
- data/lib/rspec/core/formatters/html_printer.rb +1 -0
- data/lib/rspec/core/formatters/json_formatter.rb +18 -20
- data/lib/rspec/core/formatters/profile_formatter.rb +67 -0
- data/lib/rspec/core/formatters/progress_formatter.rb +6 -7
- data/lib/rspec/core/formatters/snippet_extractor.rb +8 -6
- data/lib/rspec/core/hooks.rb +131 -125
- data/lib/rspec/core/memoized_helpers.rb +31 -26
- data/lib/rspec/core/metadata.rb +277 -184
- data/lib/rspec/core/metadata_filter.rb +86 -0
- data/lib/rspec/core/minitest_assertions_adapter.rb +28 -0
- data/lib/rspec/core/mocking_adapters/flexmock.rb +1 -1
- data/lib/rspec/core/mocking_adapters/mocha.rb +1 -1
- data/lib/rspec/core/mocking_adapters/null.rb +1 -1
- data/lib/rspec/core/mocking_adapters/rr.rb +2 -1
- data/lib/rspec/core/mocking_adapters/rspec.rb +1 -1
- data/lib/rspec/core/notifications.rb +435 -24
- data/lib/rspec/core/option_parser.rb +16 -25
- data/lib/rspec/core/ordering.rb +3 -1
- data/lib/rspec/core/pending.rb +57 -33
- data/lib/rspec/core/project_initializer.rb +2 -0
- data/lib/rspec/core/project_initializer/spec_helper.rb +5 -4
- data/lib/rspec/core/rake_task.rb +45 -20
- data/lib/rspec/core/reporter.rb +50 -22
- data/lib/rspec/core/ruby_project.rb +1 -0
- data/lib/rspec/core/runner.rb +93 -39
- data/lib/rspec/core/shared_context.rb +7 -5
- data/lib/rspec/core/shared_example_group.rb +85 -77
- data/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/lib/rspec/core/version.rb +3 -1
- data/lib/rspec/core/warnings.rb +35 -17
- data/lib/rspec/core/world.rb +57 -5
- metadata +56 -369
- metadata.gz.sig +3 -3
- data/features/README.md +0 -13
- data/features/Upgrade.md +0 -352
- data/features/command_line/README.md +0 -25
- data/features/command_line/dry_run.feature +0 -29
- data/features/command_line/example_name_option.feature +0 -97
- data/features/command_line/exit_status.feature +0 -82
- data/features/command_line/fail_fast.feature +0 -26
- data/features/command_line/format_option.feature +0 -75
- data/features/command_line/init.feature +0 -57
- data/features/command_line/line_number_appended_to_path.feature +0 -140
- data/features/command_line/line_number_option.feature +0 -58
- data/features/command_line/order.feature +0 -25
- data/features/command_line/pattern_option.feature +0 -49
- data/features/command_line/rake_task.feature +0 -122
- data/features/command_line/randomization.feature +0 -63
- data/features/command_line/require_option.feature +0 -43
- data/features/command_line/ruby.feature +0 -23
- data/features/command_line/tag.feature +0 -98
- data/features/command_line/warnings_option.feature +0 -29
- data/features/configuration/alias_example_to.feature +0 -39
- data/features/configuration/backtrace_exclusion_patterns.feature +0 -105
- data/features/configuration/custom_settings.feature +0 -84
- data/features/configuration/default_path.feature +0 -38
- data/features/configuration/deprecation_stream.feature +0 -58
- data/features/configuration/enable_global_dsl.feature +0 -54
- data/features/configuration/fail_fast.feature +0 -77
- data/features/configuration/failure_exit_code.feature +0 -36
- data/features/configuration/order_and_seed.feature +0 -3
- data/features/configuration/output_stream.feature +0 -24
- data/features/configuration/overriding_global_ordering.feature +0 -93
- data/features/configuration/pattern.feature +0 -38
- data/features/configuration/profile.feature +0 -220
- data/features/configuration/read_options_from_file.feature +0 -90
- data/features/configuration/run_all_when_everything_filtered.feature +0 -76
- data/features/example_groups/aliasing.feature +0 -48
- data/features/example_groups/basic_structure.feature +0 -55
- data/features/example_groups/shared_context.feature +0 -74
- data/features/example_groups/shared_examples.feature +0 -286
- data/features/expectation_framework_integration/configure_expectation_framework.feature +0 -102
- data/features/filtering/exclusion_filters.feature +0 -135
- data/features/filtering/if_and_unless.feature +0 -138
- data/features/filtering/inclusion_filters.feature +0 -101
- data/features/formatters/configurable_colors.feature +0 -31
- data/features/formatters/custom_formatter.feature +0 -68
- data/features/formatters/json_formatter.feature +0 -30
- data/features/formatters/regression_tests.feature +0 -95
- data/features/formatters/text_formatter.feature +0 -46
- data/features/helper_methods/arbitrary_methods.feature +0 -40
- data/features/helper_methods/let.feature +0 -50
- data/features/helper_methods/modules.feature +0 -146
- data/features/hooks/around_hooks.feature +0 -344
- data/features/hooks/before_and_after_hooks.feature +0 -427
- data/features/hooks/filtering.feature +0 -232
- data/features/metadata/current_example.feature +0 -56
- data/features/metadata/described_class.feature +0 -17
- data/features/metadata/user_defined.feature +0 -100
- data/features/mock_framework_integration/use_any_framework.feature +0 -106
- data/features/mock_framework_integration/use_flexmock.feature +0 -94
- data/features/mock_framework_integration/use_mocha.feature +0 -95
- data/features/mock_framework_integration/use_rr.feature +0 -96
- data/features/mock_framework_integration/use_rspec.feature +0 -95
- data/features/pending_and_skipped_examples/README.md +0 -3
- data/features/pending_and_skipped_examples/pending_examples.feature +0 -118
- data/features/pending_and_skipped_examples/skipped_examples.feature +0 -106
- data/features/spec_files/arbitrary_file_suffix.feature +0 -13
- data/features/step_definitions/additional_cli_steps.rb +0 -83
- data/features/subject/explicit_subject.feature +0 -101
- data/features/subject/implicit_subject.feature +0 -63
- data/features/subject/one_liner_syntax.feature +0 -71
- data/features/support/env.rb +0 -21
- data/features/support/require_expect_syntax_in_aruba_specs.rb +0 -16
- data/features/support/rubinius.rb +0 -6
- data/lib/rspec/core/command_line.rb +0 -35
- data/lib/rspec/core/drb_command_line.rb +0 -26
- data/lib/rspec/core/drb_options.rb +0 -87
- data/lib/rspec/core/formatters/legacy_formatter.rb +0 -227
- data/lib/rspec/core/shared_example_group/collection.rb +0 -27
- data/spec/command_line/order_spec.rb +0 -211
- data/spec/rspec/core/backtrace_formatter_spec.rb +0 -230
- data/spec/rspec/core/command_line_spec.rb +0 -112
- data/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/spec/rspec/core/configuration_options_spec.rb +0 -409
- data/spec/rspec/core/configuration_spec.rb +0 -1479
- data/spec/rspec/core/drb_command_line_spec.rb +0 -102
- data/spec/rspec/core/drb_options_spec.rb +0 -193
- data/spec/rspec/core/dsl_spec.rb +0 -88
- data/spec/rspec/core/example_group_spec.rb +0 -1533
- data/spec/rspec/core/example_spec.rb +0 -642
- data/spec/rspec/core/filter_manager_spec.rb +0 -229
- data/spec/rspec/core/formatters/base_formatter_spec.rb +0 -64
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +0 -303
- data/spec/rspec/core/formatters/deprecation_formatter_spec.rb +0 -208
- data/spec/rspec/core/formatters/documentation_formatter_spec.rb +0 -75
- data/spec/rspec/core/formatters/helpers_spec.rb +0 -104
- data/spec/rspec/core/formatters/html_formatted-2.1.0.html +0 -392
- data/spec/rspec/core/formatters/html_formatted.html +0 -397
- data/spec/rspec/core/formatters/html_formatter_spec.rb +0 -122
- data/spec/rspec/core/formatters/json_formatter_spec.rb +0 -206
- data/spec/rspec/core/formatters/legacy_formatter_spec.rb +0 -137
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -43
- data/spec/rspec/core/formatters/snippet_extractor_spec.rb +0 -26
- data/spec/rspec/core/formatters_spec.rb +0 -120
- data/spec/rspec/core/hooks_filtering_spec.rb +0 -227
- data/spec/rspec/core/hooks_spec.rb +0 -294
- data/spec/rspec/core/memoized_helpers_spec.rb +0 -495
- data/spec/rspec/core/metadata_spec.rb +0 -491
- data/spec/rspec/core/option_parser_spec.rb +0 -262
- data/spec/rspec/core/ordering_spec.rb +0 -102
- data/spec/rspec/core/pending_example_spec.rb +0 -117
- data/spec/rspec/core/pending_spec.rb +0 -8
- data/spec/rspec/core/project_initializer_spec.rb +0 -73
- data/spec/rspec/core/rake_task_spec.rb +0 -146
- data/spec/rspec/core/random_spec.rb +0 -47
- data/spec/rspec/core/reporter_spec.rb +0 -155
- data/spec/rspec/core/resources/a_bar.rb +0 -0
- data/spec/rspec/core/resources/a_foo.rb +0 -0
- data/spec/rspec/core/resources/a_spec.rb +0 -1
- data/spec/rspec/core/resources/custom_example_group_runner.rb +0 -14
- data/spec/rspec/core/resources/formatter_specs.rb +0 -58
- data/spec/rspec/core/resources/utf8_encoded.rb +0 -8
- data/spec/rspec/core/rspec_matchers_spec.rb +0 -45
- data/spec/rspec/core/ruby_project_spec.rb +0 -26
- data/spec/rspec/core/runner_spec.rb +0 -151
- data/spec/rspec/core/shared_context_spec.rb +0 -102
- data/spec/rspec/core/shared_example_group/collection_spec.rb +0 -57
- data/spec/rspec/core/shared_example_group_spec.rb +0 -114
- data/spec/rspec/core/warnings_spec.rb +0 -29
- data/spec/rspec/core/world_spec.rb +0 -142
- data/spec/rspec/core_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -160
- data/spec/support/config_options_helper.rb +0 -13
- data/spec/support/formatter_support.rb +0 -83
- data/spec/support/helper_methods.rb +0 -26
- data/spec/support/isolate_load_path_mutation.rb +0 -5
- data/spec/support/isolated_directory.rb +0 -10
- data/spec/support/isolated_home_directory.rb +0 -16
- data/spec/support/legacy_formatter_using_sub_classing_example.rb +0 -87
- data/spec/support/matchers.rb +0 -85
- data/spec/support/mathn_integration_support.rb +0 -12
- data/spec/support/old_style_formatter_example.rb +0 -69
- data/spec/support/shared_example_groups.rb +0 -13
- data/spec/support/spec_files.rb +0 -44
- data/spec/support/stderr_splitter.rb +0 -36
@@ -1,13 +0,0 @@
|
|
1
|
-
module ConfigOptionsHelper
|
2
|
-
extend RSpec::SharedContext
|
3
|
-
|
4
|
-
around(:each) { |e| without_env_vars('SPEC_OPTS', &e) }
|
5
|
-
|
6
|
-
def config_options_object(*args)
|
7
|
-
RSpec::Core::ConfigurationOptions.new(args)
|
8
|
-
end
|
9
|
-
|
10
|
-
def parse_options(*args)
|
11
|
-
config_options_object(*args).options
|
12
|
-
end
|
13
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
module FormatterSupport
|
2
|
-
|
3
|
-
def send_notification type, notification
|
4
|
-
reporter.notify type, notification
|
5
|
-
end
|
6
|
-
|
7
|
-
def reporter
|
8
|
-
@reporter ||= setup_reporter
|
9
|
-
end
|
10
|
-
|
11
|
-
def setup_reporter(*streams)
|
12
|
-
config.add_formatter described_class, *streams
|
13
|
-
@formatter = config.formatters.first
|
14
|
-
@reporter = config.reporter
|
15
|
-
end
|
16
|
-
|
17
|
-
def output
|
18
|
-
@output ||= StringIO.new
|
19
|
-
end
|
20
|
-
|
21
|
-
def config
|
22
|
-
@configuration ||=
|
23
|
-
begin
|
24
|
-
config = RSpec::Core::Configuration.new
|
25
|
-
config.output_stream = output
|
26
|
-
config
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def configure
|
31
|
-
yield config
|
32
|
-
end
|
33
|
-
|
34
|
-
def formatter
|
35
|
-
@formatter ||=
|
36
|
-
begin
|
37
|
-
setup_reporter
|
38
|
-
@formatter
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def example
|
43
|
-
instance_double("RSpec::Core::Example",
|
44
|
-
:description => "Example",
|
45
|
-
:full_description => "Example",
|
46
|
-
:execution_result => { :exception => Exception.new },
|
47
|
-
:metadata => {}
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
|
-
def group
|
52
|
-
class_double "RSpec::Core::ExampleGroup", :description => "Group"
|
53
|
-
end
|
54
|
-
|
55
|
-
def count_notification(count)
|
56
|
-
::RSpec::Core::Notifications::CountNotification.new count
|
57
|
-
end
|
58
|
-
|
59
|
-
def example_notification(specific_example = example)
|
60
|
-
::RSpec::Core::Notifications::ExampleNotification.new specific_example
|
61
|
-
end
|
62
|
-
|
63
|
-
def group_notification
|
64
|
-
::RSpec::Core::Notifications::GroupNotification.new group
|
65
|
-
end
|
66
|
-
|
67
|
-
def message_notification(message)
|
68
|
-
::RSpec::Core::Notifications::MessageNotification.new message
|
69
|
-
end
|
70
|
-
|
71
|
-
def null_notification
|
72
|
-
::RSpec::Core::Notifications::NullNotification
|
73
|
-
end
|
74
|
-
|
75
|
-
def seed_notification(seed, used = true)
|
76
|
-
::RSpec::Core::Notifications::SeedNotification.new seed, used
|
77
|
-
end
|
78
|
-
|
79
|
-
def summary_notification(duration, examples, failed, pending)
|
80
|
-
::RSpec::Core::Notifications::SummaryNotification.new duration, examples, failed, pending
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module RSpecHelpers
|
2
|
-
def relative_path(path)
|
3
|
-
RSpec::Core::Metadata.relative_path(path)
|
4
|
-
end
|
5
|
-
|
6
|
-
def ignoring_warnings
|
7
|
-
original = $VERBOSE
|
8
|
-
$VERBOSE = nil
|
9
|
-
result = yield
|
10
|
-
$VERBOSE = original
|
11
|
-
result
|
12
|
-
end
|
13
|
-
|
14
|
-
def safely
|
15
|
-
Thread.new do
|
16
|
-
ignoring_warnings { $SAFE = 3 }
|
17
|
-
yield
|
18
|
-
end.join
|
19
|
-
|
20
|
-
# $SAFE is not supported on Rubinius
|
21
|
-
unless defined?(Rubinius)
|
22
|
-
expect($SAFE).to eql 0 # $SAFE should not have changed in this thread.
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'tmpdir'
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
RSpec.shared_context "isolated home directory", :isolated_home => true do
|
5
|
-
around do |ex|
|
6
|
-
Dir.mktmpdir do |tmp_dir|
|
7
|
-
original_home = ENV['HOME']
|
8
|
-
begin
|
9
|
-
ENV['HOME'] = tmp_dir
|
10
|
-
ex.call
|
11
|
-
ensure
|
12
|
-
ENV['HOME'] = original_home
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,87 +0,0 @@
|
|
1
|
-
require 'rspec/core/formatters/base_text_formatter'
|
2
|
-
|
3
|
-
class LegacyFormatterUsingSubClassing < RSpec::Core::Formatters::BaseTextFormatter
|
4
|
-
|
5
|
-
def initialize(output)
|
6
|
-
super nil
|
7
|
-
@output = output
|
8
|
-
end
|
9
|
-
|
10
|
-
def start(example_count)
|
11
|
-
super
|
12
|
-
@output.puts "Started #{example_count.to_s} examples"
|
13
|
-
end
|
14
|
-
|
15
|
-
def example_group_started(group)
|
16
|
-
super
|
17
|
-
@output.puts "Started #{group.description}"
|
18
|
-
end
|
19
|
-
|
20
|
-
def example_group_finished(group)
|
21
|
-
super
|
22
|
-
@output.puts "Finished #{group.description}"
|
23
|
-
end
|
24
|
-
|
25
|
-
def example_started(example)
|
26
|
-
super
|
27
|
-
@output.puts "Started #{example.full_description}"
|
28
|
-
end
|
29
|
-
|
30
|
-
def stop
|
31
|
-
super
|
32
|
-
@output.puts "Stopped"
|
33
|
-
end
|
34
|
-
|
35
|
-
def message(message)
|
36
|
-
super
|
37
|
-
@output.puts message
|
38
|
-
end
|
39
|
-
|
40
|
-
def dump_failures
|
41
|
-
super
|
42
|
-
@output.puts "Failures:"
|
43
|
-
end
|
44
|
-
|
45
|
-
def dump_summary(duration, example_count, failure_count, pending_count)
|
46
|
-
super
|
47
|
-
@output.puts "\nFinished in #{duration}\n" +
|
48
|
-
"#{failure_count}/#{example_count} failed.\n" +
|
49
|
-
"#{pending_count} pending."
|
50
|
-
end
|
51
|
-
|
52
|
-
def dump_pending
|
53
|
-
super
|
54
|
-
@output.puts "Pending:"
|
55
|
-
end
|
56
|
-
|
57
|
-
def seed(number)
|
58
|
-
super
|
59
|
-
@output.puts "Randomized with seed #{number}"
|
60
|
-
end
|
61
|
-
|
62
|
-
def close
|
63
|
-
super
|
64
|
-
@output.close
|
65
|
-
end
|
66
|
-
|
67
|
-
def example_passed(example)
|
68
|
-
super
|
69
|
-
@output.print '.'
|
70
|
-
end
|
71
|
-
|
72
|
-
def example_pending(example)
|
73
|
-
super
|
74
|
-
@output.print 'P'
|
75
|
-
end
|
76
|
-
|
77
|
-
def example_failed(example)
|
78
|
-
super
|
79
|
-
@output.print 'F'
|
80
|
-
end
|
81
|
-
|
82
|
-
def start_dump
|
83
|
-
super
|
84
|
-
@output.puts "Dumping!"
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
data/spec/support/matchers.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
RSpec::Matchers.define :map_specs do |specs|
|
2
|
-
match do |autotest|
|
3
|
-
@specs = specs
|
4
|
-
@autotest = prepare(autotest)
|
5
|
-
autotest.test_files_for(@file) == specs
|
6
|
-
end
|
7
|
-
|
8
|
-
chain :to do |file|
|
9
|
-
@file = file
|
10
|
-
end
|
11
|
-
|
12
|
-
failure_message_for_should do
|
13
|
-
"expected #{@autotest.class} to map #{@specs.inspect} to #{@file.inspect}\ngot #{@actual.inspect}"
|
14
|
-
end
|
15
|
-
|
16
|
-
def prepare(autotest)
|
17
|
-
find_order = @specs.dup << @file
|
18
|
-
autotest.instance_eval { @find_order = find_order }
|
19
|
-
autotest
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
RSpec::Matchers.define :fail_with do |exception_klass|
|
24
|
-
match do |example|
|
25
|
-
failure_reason(example, exception_klass).nil?
|
26
|
-
end
|
27
|
-
|
28
|
-
failure_message_for_should do |example|
|
29
|
-
"expected example to fail with a #{exception_klass} exception, but #{failure_reason(example, exception_klass)}"
|
30
|
-
end
|
31
|
-
|
32
|
-
def failure_reason(example, exception_klass)
|
33
|
-
result = example.metadata[:execution_result]
|
34
|
-
case
|
35
|
-
when example.metadata[:pending] then "was pending"
|
36
|
-
when result[:status] != 'failed' then result[:status]
|
37
|
-
when !result[:exception].is_a?(exception_klass) then "failed with a #{result[:exception].class}"
|
38
|
-
else nil
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
RSpec::Matchers.define :pass do
|
44
|
-
match do |example|
|
45
|
-
failure_reason(example).nil?
|
46
|
-
end
|
47
|
-
|
48
|
-
failure_message_for_should do |example|
|
49
|
-
"expected example to pass, but #{failure_reason(example)}"
|
50
|
-
end
|
51
|
-
|
52
|
-
def failure_reason(example)
|
53
|
-
result = example.metadata[:execution_result]
|
54
|
-
case
|
55
|
-
when example.metadata[:pending] then "was pending"
|
56
|
-
when result[:status] != 'passed' then result[:status]
|
57
|
-
else nil
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
RSpec::Matchers.module_eval do
|
63
|
-
alias_method :have_failed_with, :fail_with
|
64
|
-
alias_method :have_passed, :pass
|
65
|
-
end
|
66
|
-
|
67
|
-
RSpec::Matchers.define :be_pending_with do |message|
|
68
|
-
match do |example|
|
69
|
-
example.pending? && example.metadata[:execution_result][:pending_message] == message
|
70
|
-
end
|
71
|
-
|
72
|
-
failure_message_for_should do |example|
|
73
|
-
"expected: example pending with #{message.inspect}\n got: #{example.metadata[:execution_result][:pending_message].inspect}"
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
RSpec::Matchers.define :be_skipped_with do |message|
|
78
|
-
match do |example|
|
79
|
-
example.skipped? && example.metadata[:execution_result][:pending_message] == message
|
80
|
-
end
|
81
|
-
|
82
|
-
failure_message_for_should do |example|
|
83
|
-
"expected: example skipped with #{message.inspect}\n got: #{example.metadata[:execution_result][:pending_message].inspect}"
|
84
|
-
end
|
85
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
class OldStyleFormatterExample
|
2
|
-
|
3
|
-
def initialize(output)
|
4
|
-
@output = output
|
5
|
-
end
|
6
|
-
|
7
|
-
def start(example_count)
|
8
|
-
@output.puts "Started #{example_count.to_s} examples"
|
9
|
-
end
|
10
|
-
|
11
|
-
def example_group_started(group)
|
12
|
-
@output.puts "Started #{group.description}"
|
13
|
-
end
|
14
|
-
|
15
|
-
def example_group_finished(group)
|
16
|
-
@output.puts "Finished #{group.description}"
|
17
|
-
end
|
18
|
-
|
19
|
-
def example_started(example)
|
20
|
-
@output.puts "Started #{example.full_description}"
|
21
|
-
end
|
22
|
-
|
23
|
-
def stop
|
24
|
-
@output.puts "Stopped"
|
25
|
-
end
|
26
|
-
|
27
|
-
def message(message)
|
28
|
-
@output.puts message
|
29
|
-
end
|
30
|
-
|
31
|
-
def dump_failures
|
32
|
-
@output.puts "Failures:"
|
33
|
-
end
|
34
|
-
|
35
|
-
def dump_summary(duration, example_count, failure_count, pending_count)
|
36
|
-
@output.puts "\nFinished in #{duration}\n" +
|
37
|
-
"#{failure_count}/#{example_count} failed.\n" +
|
38
|
-
"#{pending_count} pending."
|
39
|
-
end
|
40
|
-
|
41
|
-
def dump_pending
|
42
|
-
@output.puts "Pending:"
|
43
|
-
end
|
44
|
-
|
45
|
-
def seed(number)
|
46
|
-
@output.puts "Randomized with seed #{number}"
|
47
|
-
end
|
48
|
-
|
49
|
-
def close
|
50
|
-
@output.close
|
51
|
-
end
|
52
|
-
|
53
|
-
def example_passed(example)
|
54
|
-
@output.print '.'
|
55
|
-
end
|
56
|
-
|
57
|
-
def example_pending(example)
|
58
|
-
@output.print 'P'
|
59
|
-
end
|
60
|
-
|
61
|
-
def example_failed(example)
|
62
|
-
@output.print 'F'
|
63
|
-
end
|
64
|
-
|
65
|
-
def start_dump
|
66
|
-
@output.puts "Dumping!"
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
RSpec.shared_examples_for "metadata hash builder" do
|
2
|
-
let(:hash) { metadata_hash(:foo, :bar, :bazz => 23) }
|
3
|
-
|
4
|
-
it 'treats symbols as metadata keys with a true value' do
|
5
|
-
expect(hash[:foo]).to be(true)
|
6
|
-
expect(hash[:bar]).to be(true)
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'still processes hash values normally' do
|
10
|
-
expect(hash[:bazz]).to be(23)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
data/spec/support/spec_files.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
RSpec.shared_context "spec files" do
|
2
|
-
def failing_spec_filename
|
3
|
-
@failing_spec_filename ||= File.expand_path(File.dirname(__FILE__)) + "/_failing_spec.rb"
|
4
|
-
end
|
5
|
-
|
6
|
-
def passing_spec_filename
|
7
|
-
@passing_spec_filename ||= File.expand_path(File.dirname(__FILE__)) + "/_passing_spec.rb"
|
8
|
-
end
|
9
|
-
|
10
|
-
def create_passing_spec_file
|
11
|
-
File.open(passing_spec_filename, 'w') do |f|
|
12
|
-
f.write %q{
|
13
|
-
RSpec.describe "passing spec" do
|
14
|
-
it "passes" do
|
15
|
-
expect(1).to eq(1)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def create_failing_spec_file
|
23
|
-
File.open(failing_spec_filename, 'w') do |f|
|
24
|
-
f.write %q{
|
25
|
-
RSpec.describe "failing spec" do
|
26
|
-
it "fails" do
|
27
|
-
expect(1).to eq(2)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
}
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
before(:all) do
|
35
|
-
create_passing_spec_file
|
36
|
-
create_failing_spec_file
|
37
|
-
end
|
38
|
-
|
39
|
-
after(:all) do
|
40
|
-
File.delete(passing_spec_filename)
|
41
|
-
File.delete(failing_spec_filename)
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|