rspec-core 2.5.2 → 2.6.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +10 -13
- data/README.md +4 -1
- data/Rakefile +29 -12
- data/cucumber.yml +1 -1
- data/features/.nav +10 -4
- data/features/Autotest.md +31 -7
- data/features/Changelog.md +36 -6
- data/features/command_line/configure.feature +2 -2
- data/features/command_line/example_name_option.feature +10 -10
- data/features/command_line/exit_status.feature +4 -4
- data/features/command_line/format_option.feature +4 -4
- data/features/command_line/line_number_appended_to_path.feature +11 -11
- data/features/command_line/line_number_option.feature +2 -2
- data/features/command_line/rake_task.feature +3 -3
- data/features/command_line/tag.feature +26 -10
- data/features/configuration/alias_example_to.feature +48 -0
- data/features/configuration/custom_settings.feature +3 -3
- data/features/configuration/fail_fast.feature +3 -3
- data/features/configuration/read_options_from_file.feature +4 -4
- data/features/example_groups/basic_structure.feature +11 -15
- data/features/example_groups/shared_context.feature +74 -0
- data/features/example_groups/shared_example_group.feature +21 -17
- data/features/expectation_framework_integration/configure_expectation_framework.feature +15 -4
- data/features/filtering/exclusion_filters.feature +28 -4
- data/features/filtering/{implicit_filters.feature → if_and_unless.feature} +9 -7
- data/features/filtering/inclusion_filters.feature +26 -3
- data/features/filtering/run_all_when_everything_filtered.feature +1 -1
- data/features/formatters/custom_formatter.feature +1 -1
- data/features/formatters/text_formatter.feature +45 -0
- data/features/helper_methods/arbitrary_methods.feature +2 -2
- data/features/helper_methods/let.feature +2 -2
- data/features/helper_methods/modules.feature +149 -0
- data/features/hooks/around_hooks.feature +11 -11
- data/features/hooks/before_and_after_hooks.feature +15 -19
- data/features/hooks/filtering.feature +160 -124
- data/features/metadata/current_example.feature +17 -0
- data/features/metadata/described_class.feature +2 -2
- data/features/metadata/user_defined.feature +111 -0
- data/features/mock_framework_integration/use_any_framework.feature +1 -1
- data/features/mock_framework_integration/use_flexmock.feature +83 -10
- data/features/mock_framework_integration/use_mocha.feature +84 -10
- data/features/mock_framework_integration/use_rr.feature +85 -10
- data/features/mock_framework_integration/use_rspec.feature +84 -10
- data/features/pending/pending_examples.feature +8 -8
- data/features/spec_files/arbitrary_file_suffix.feature +1 -1
- data/features/step_definitions/additional_cli_steps.rb +11 -1
- data/features/subject/attribute_of_subject.feature +24 -4
- data/features/subject/explicit_subject.feature +5 -5
- data/features/subject/implicit_receiver.feature +2 -2
- data/features/subject/implicit_subject.feature +2 -2
- data/features/support/env.rb +6 -1
- data/lib/rspec/core.rb +22 -0
- data/lib/rspec/core/backward_compatibility.rb +12 -2
- data/lib/rspec/core/command_line.rb +1 -4
- data/lib/rspec/core/configuration.rb +25 -17
- data/lib/rspec/core/configuration_options.rb +6 -23
- data/lib/rspec/core/drb_command_line.rb +5 -11
- data/lib/rspec/core/example.rb +29 -21
- data/lib/rspec/core/example_group.rb +36 -4
- data/lib/rspec/core/formatters/base_formatter.rb +6 -0
- data/lib/rspec/core/formatters/base_text_formatter.rb +1 -1
- data/lib/rspec/core/formatters/helpers.rb +0 -4
- data/lib/rspec/core/hooks.rb +14 -4
- data/lib/rspec/core/metadata.rb +1 -1
- data/lib/rspec/core/metadata_hash_builder.rb +93 -0
- data/lib/rspec/core/mocking/with_flexmock.rb +2 -0
- data/lib/rspec/core/mocking/with_mocha.rb +2 -0
- data/lib/rspec/core/mocking/with_rr.rb +2 -0
- data/lib/rspec/core/mocking/with_rspec.rb +3 -1
- data/lib/rspec/core/option_parser.rb +5 -2
- data/lib/rspec/core/pending.rb +10 -3
- data/lib/rspec/core/reporter.rb +2 -2
- data/lib/rspec/core/runner.rb +7 -1
- data/lib/rspec/core/shared_example_group.rb +18 -4
- data/lib/rspec/core/subject.rb +4 -6
- data/lib/rspec/core/version.rb +1 -1
- data/lib/rspec/core/world.rb +16 -4
- data/rspec-core.gemspec +4 -3
- data/spec.txt +1126 -0
- data/spec/autotest/failed_results_re_spec.rb +2 -2
- data/spec/rspec/core/command_line_spec.rb +0 -2
- data/spec/rspec/core/configuration_spec.rb +84 -1
- data/spec/rspec/core/deprecations_spec.rb +21 -0
- data/spec/rspec/core/drb_command_line_spec.rb +3 -11
- data/spec/rspec/core/example_group_spec.rb +213 -56
- data/spec/rspec/core/example_spec.rb +110 -0
- data/spec/rspec/core/formatters/base_formatter_spec.rb +23 -2
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +9 -0
- data/spec/rspec/core/formatters/helpers_spec.rb +1 -1
- data/spec/rspec/core/formatters/html_formatted-1.8.6.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +8 -10
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.9.1.html +5 -5
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +5 -5
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -1
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +5 -5
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +8 -10
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +5 -5
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +5 -5
- data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +5 -5
- data/spec/rspec/core/hooks_spec.rb +86 -0
- data/spec/rspec/core/metadata_spec.rb +7 -7
- data/spec/rspec/core/option_parser_spec.rb +8 -0
- data/spec/rspec/core/pending_example_spec.rb +12 -51
- data/spec/rspec/core/reporter_spec.rb +19 -3
- data/spec/rspec/core/resources/formatter_specs.rb +7 -1
- data/spec/rspec/core/rspec_matchers_spec.rb +45 -0
- data/spec/rspec/core/runner_spec.rb +35 -10
- data/spec/rspec/core/shared_example_group_spec.rb +57 -21
- data/spec/rspec/core/subject_spec.rb +32 -11
- data/spec/rspec/core/world_spec.rb +38 -15
- data/spec/rspec/core_spec.rb +28 -0
- data/spec/spec_helper.rb +22 -2
- data/spec/support/matchers.rb +44 -13
- data/spec/support/shared_example_groups.rb +41 -0
- metadata +39 -16
@@ -1,3 +1,6 @@
|
|
1
|
+
# http://www.ruby-doc.org/stdlib/libdoc/optparse/rdoc/classes/OptionParser.html
|
2
|
+
require 'optparse'
|
3
|
+
|
1
4
|
module RSpec::Core
|
2
5
|
class Parser
|
3
6
|
def self.parse!(args)
|
@@ -33,13 +36,13 @@ module RSpec::Core
|
|
33
36
|
options[:color_enabled] = o
|
34
37
|
end
|
35
38
|
|
36
|
-
parser.on('-d', '--
|
39
|
+
parser.on('-d', '--debugger', 'Enable debugging') do |o|
|
37
40
|
options[:debug] = true
|
38
41
|
end
|
39
42
|
|
40
43
|
parser.on('-e', '--example PATTERN', "Run examples whose full descriptions match this pattern",
|
41
44
|
"(PATTERN is compiled into a Ruby regular expression)") do |o|
|
42
|
-
options[:full_description] =
|
45
|
+
options[:full_description] = Regexp.compile(Regexp.escape(o))
|
43
46
|
end
|
44
47
|
|
45
48
|
parser.on('-f', '--format FORMATTER', 'Choose a formatter',
|
data/lib/rspec/core/pending.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Core
|
3
3
|
module Pending
|
4
|
+
class PendingDeclaredInExample < StandardError; end
|
5
|
+
|
4
6
|
DEFAULT_MESSAGE = 'No reason given'
|
5
7
|
|
6
8
|
def pending(*args)
|
@@ -17,13 +19,18 @@ module RSpec
|
|
17
19
|
example.metadata[:execution_result][:pending_message] = message
|
18
20
|
if block_given?
|
19
21
|
begin
|
20
|
-
result =
|
22
|
+
result = begin
|
23
|
+
yield
|
24
|
+
example.example_group_instance.instance_eval { verify_mocks_for_rspec }
|
25
|
+
end
|
21
26
|
example.metadata[:pending] = false
|
22
|
-
rescue Exception
|
27
|
+
rescue Exception
|
28
|
+
ensure
|
29
|
+
teardown_mocks_for_rspec
|
23
30
|
end
|
24
31
|
raise RSpec::Core::PendingExampleFixedError.new if result
|
25
32
|
end
|
26
|
-
|
33
|
+
raise PendingDeclaredInExample.new(message)
|
27
34
|
end
|
28
35
|
end
|
29
36
|
end
|
data/lib/rspec/core/reporter.rb
CHANGED
@@ -39,11 +39,11 @@ module RSpec::Core
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def example_group_started(group)
|
42
|
-
notify :example_group_started, group
|
42
|
+
notify :example_group_started, group unless group.descendant_filtered_examples.empty?
|
43
43
|
end
|
44
44
|
|
45
45
|
def example_group_finished(group)
|
46
|
-
notify :example_group_finished, group
|
46
|
+
notify :example_group_finished, group unless group.descendant_filtered_examples.empty?
|
47
47
|
end
|
48
48
|
|
49
49
|
def example_started(example)
|
data/lib/rspec/core/runner.rb
CHANGED
@@ -9,6 +9,7 @@ module RSpec
|
|
9
9
|
@installed_at_exit = true
|
10
10
|
at_exit { run(ARGV, $stderr, $stdout) ? exit(0) : exit(1) }
|
11
11
|
end
|
12
|
+
AT_EXIT_HOOK_BACKTRACE_LINE = "#{__FILE__}:#{__LINE__ - 2}:in `autorun'"
|
12
13
|
|
13
14
|
def self.autorun_disabled?
|
14
15
|
@autorun_disabled ||= false
|
@@ -41,7 +42,12 @@ module RSpec
|
|
41
42
|
options.parse_options
|
42
43
|
|
43
44
|
if options.options[:drb]
|
44
|
-
|
45
|
+
begin
|
46
|
+
run_over_drb(options, err, out)
|
47
|
+
rescue DRb::DRbConnError
|
48
|
+
err.puts "No DRb server is running. Running in local process instead ..."
|
49
|
+
run_in_process(options, err, out)
|
50
|
+
end
|
45
51
|
else
|
46
52
|
run_in_process(options, err, out)
|
47
53
|
end
|
@@ -2,12 +2,26 @@ module RSpec
|
|
2
2
|
module Core
|
3
3
|
module SharedExampleGroup
|
4
4
|
|
5
|
-
def
|
6
|
-
|
7
|
-
|
5
|
+
def shared_context(*args, &block)
|
6
|
+
if String === args.first || Symbol === args.first
|
7
|
+
name = args.shift
|
8
|
+
ensure_shared_example_group_name_not_taken(name)
|
9
|
+
RSpec.world.shared_example_groups[name] = block
|
10
|
+
end
|
11
|
+
|
12
|
+
unless args.empty?
|
13
|
+
mod = Module.new
|
14
|
+
(class << mod; self; end).send(:define_method, :extended) do |host|
|
15
|
+
host.class_eval(&block)
|
16
|
+
end
|
17
|
+
RSpec.configuration.extend(mod, *args)
|
18
|
+
else
|
19
|
+
end
|
8
20
|
end
|
9
21
|
|
10
|
-
alias :
|
22
|
+
alias :shared_examples :shared_context
|
23
|
+
alias :share_examples_for :shared_context
|
24
|
+
alias :shared_examples_for :shared_context
|
11
25
|
|
12
26
|
def share_as(name, &block)
|
13
27
|
if Object.const_defined?(name)
|
data/lib/rspec/core/subject.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'ostruct'
|
2
|
-
|
3
1
|
module RSpec
|
4
2
|
module Core
|
5
3
|
module Subject
|
@@ -108,14 +106,14 @@ module RSpec
|
|
108
106
|
#
|
109
107
|
# describe "a configuration Hash" do
|
110
108
|
# subject do
|
111
|
-
# {
|
109
|
+
# { :max_users => 3,
|
112
110
|
# 'admin' => :all_permissions }
|
113
111
|
# end
|
114
112
|
#
|
115
113
|
# its([:max_users]) { should == 3 }
|
116
114
|
# its(['admin']) { should == :all_permissions }
|
117
115
|
#
|
118
|
-
# #
|
116
|
+
# # You can still access to its regular methods this way:
|
119
117
|
# its(:keys) { should include(:max_users) }
|
120
118
|
# its(:count) { should == 2 }
|
121
119
|
# end
|
@@ -124,8 +122,8 @@ module RSpec
|
|
124
122
|
example do
|
125
123
|
self.class.class_eval do
|
126
124
|
define_method(:subject) do
|
127
|
-
@_subject ||= if
|
128
|
-
|
125
|
+
@_subject ||= if attribute.is_a?(Array)
|
126
|
+
super()[*attribute]
|
129
127
|
else
|
130
128
|
attribute.to_s.split('.').inject(super()) do |target, method|
|
131
129
|
target.send(method)
|
data/lib/rspec/core/version.rb
CHANGED
data/lib/rspec/core/world.rb
CHANGED
@@ -54,28 +54,40 @@ module RSpec
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def preceding_declaration_line(filter_line)
|
57
|
-
declaration_line_numbers.inject(nil) do |highest_prior_declaration_line, line|
|
57
|
+
declaration_line_numbers.sort.inject(nil) do |highest_prior_declaration_line, line|
|
58
58
|
line <= filter_line ? line : highest_prior_declaration_line
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
62
|
+
def announce_filters
|
63
|
+
filter_announcements = []
|
64
|
+
announce_inclusion_filter filter_announcements
|
65
|
+
announce_exclusion_filter filter_announcements
|
66
|
+
|
67
|
+
unless filter_announcements.empty?
|
68
|
+
@configuration.reporter.message("Run filtered #{filter_announcements.join(', ')}")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def announce_inclusion_filter(announcements)
|
63
73
|
if inclusion_filter
|
64
74
|
if @configuration.run_all_when_everything_filtered? && RSpec.world.example_count.zero?
|
65
75
|
@configuration.reporter.message "No examples were matched by #{inclusion_filter.inspect}, running all"
|
66
76
|
@configuration.clear_inclusion_filter
|
67
77
|
filtered_examples.clear
|
68
78
|
else
|
69
|
-
|
79
|
+
announcements << "using #{inclusion_filter.inspect}"
|
70
80
|
end
|
71
81
|
end
|
72
82
|
end
|
73
83
|
|
74
|
-
def announce_exclusion_filter
|
84
|
+
def announce_exclusion_filter(announcements)
|
75
85
|
if exclusion_filter && RSpec.world.example_count.zero?
|
76
86
|
@configuration.reporter.message(
|
77
87
|
"No examples were matched. Perhaps #{exclusion_filter.inspect} is excluding everything?")
|
78
88
|
example_groups.clear
|
89
|
+
else
|
90
|
+
announcements << "excluding #{exclusion_filter.inspect}"
|
79
91
|
end
|
80
92
|
end
|
81
93
|
|
data/rspec-core.gemspec
CHANGED
@@ -7,11 +7,12 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = RSpec::Core::Version::STRING
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Chad Humphries", "David Chelimsky"]
|
10
|
-
s.email = "
|
11
|
-
s.homepage = "http://github.com/rspec
|
10
|
+
s.email = "rspec-users@rubyforge.org;"
|
11
|
+
s.homepage = "http://github.com/rspec"
|
12
12
|
s.summary = "rspec-core-#{RSpec::Core::Version::STRING}"
|
13
|
-
s.description = "RSpec runner and example groups"
|
13
|
+
s.description = "BDD for Ruby. RSpec runner and example groups."
|
14
14
|
|
15
|
+
s.rubygems_version = "1.3.7"
|
15
16
|
s.rubyforge_project = "rspec"
|
16
17
|
|
17
18
|
s.files = `git ls-files`.split("\n")
|
data/spec.txt
ADDED
@@ -0,0 +1,1126 @@
|
|
1
|
+
autotest/discover.rb
|
2
|
+
with /.rspec present
|
3
|
+
adds 'rspec2' to the list of discoveries
|
4
|
+
with /.rspec absent
|
5
|
+
does not add 'rspec2' to the list of discoveries
|
6
|
+
|
7
|
+
failed_results_re for autotest
|
8
|
+
output does not have color enabled
|
9
|
+
matches a failure
|
10
|
+
output has color enabled
|
11
|
+
matches a failure
|
12
|
+
|
13
|
+
Autotest::Rspec2
|
14
|
+
uses autotest's prefix
|
15
|
+
commands
|
16
|
+
makes the appropriate test command
|
17
|
+
returns a blank command for no files
|
18
|
+
quotes the paths of files to test
|
19
|
+
gives '--tty' to /Users/david/projects/ruby/rspec2/repos/rspec-core/bin/rspec, not '--autotest'
|
20
|
+
mappings
|
21
|
+
finds the spec file for a given lib file
|
22
|
+
finds the spec file if given a spec file
|
23
|
+
ignores files in spec dir that aren't specs
|
24
|
+
ignores untracked files (in @file)
|
25
|
+
consolidating failures
|
26
|
+
returns no failures if no failures were given in the output
|
27
|
+
returns a hash with the spec filename => spec name for each failure or error
|
28
|
+
when subject file appears before the spec file in the backtrace
|
29
|
+
excludes the subject file
|
30
|
+
includes the spec file
|
31
|
+
normalizing file names
|
32
|
+
ensures that a single file appears in files_to_test only once
|
33
|
+
|
34
|
+
RSpec::Core::CommandLineConfiguration
|
35
|
+
#run
|
36
|
+
given autotest command
|
37
|
+
calls Autotest.generate
|
38
|
+
given unsupported command
|
39
|
+
raises ArgumentError
|
40
|
+
|
41
|
+
RSpec::Core::CommandLine
|
42
|
+
given an Array of options
|
43
|
+
assigns ConfigurationOptions built from Array to @options
|
44
|
+
given a ConfigurationOptions object
|
45
|
+
assigns it to @options
|
46
|
+
#run
|
47
|
+
configures streams before command line options
|
48
|
+
runs before suite hooks
|
49
|
+
runs after suite hooks
|
50
|
+
runs after suite hooks even after an error
|
51
|
+
#run with custom output
|
52
|
+
doesn't override output_stream
|
53
|
+
|
54
|
+
RSpec::Core::ConfigurationOptions
|
55
|
+
#configure
|
56
|
+
sends libs before requires
|
57
|
+
sends requires before formatter
|
58
|
+
-c, --color, and --colour
|
59
|
+
sets :color_enabled => true
|
60
|
+
--no-color
|
61
|
+
sets :color_enabled => false
|
62
|
+
-I
|
63
|
+
adds to :libs
|
64
|
+
can be used more than once
|
65
|
+
--require
|
66
|
+
requires files
|
67
|
+
can be used more than once
|
68
|
+
--format, -f
|
69
|
+
sets :formatter
|
70
|
+
can accept a class name
|
71
|
+
--profile, -p
|
72
|
+
sets :profile_examples => true
|
73
|
+
--line_number
|
74
|
+
sets :line_number
|
75
|
+
--example
|
76
|
+
sets :full_description
|
77
|
+
--backtrace, -b
|
78
|
+
sets full_backtrace on config
|
79
|
+
--debug, -d
|
80
|
+
sets :debug => true
|
81
|
+
--fail-fast
|
82
|
+
defaults to false
|
83
|
+
sets fail_fast on config
|
84
|
+
--options
|
85
|
+
sets :custom_options_file
|
86
|
+
--drb, -X
|
87
|
+
does not send --drb back to the parser after parsing options
|
88
|
+
combined with --debug
|
89
|
+
turns off the debugger if --drb is specified first
|
90
|
+
turns off the debugger option if --drb is specified later
|
91
|
+
turns off the debugger option if --drb is specified in the options file
|
92
|
+
turns off the debugger option if --debug is specified in the options file
|
93
|
+
files_or_directories_to_run
|
94
|
+
parses files from '-c file.rb dir/file.rb'
|
95
|
+
parses dir from 'dir'
|
96
|
+
parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'
|
97
|
+
provides no files or directories if spec directory does not exist
|
98
|
+
parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'
|
99
|
+
#drb_argv
|
100
|
+
preserves extra arguments
|
101
|
+
includes --fail-fast
|
102
|
+
includes --options
|
103
|
+
with tags
|
104
|
+
includes the tags
|
105
|
+
leaves tags intact
|
106
|
+
with formatters
|
107
|
+
includes the formatters
|
108
|
+
leaves formatters intact
|
109
|
+
leaves output intact
|
110
|
+
--drb specified in ARGV
|
111
|
+
renders all the original arguments except --drb
|
112
|
+
--drb specified in the options file
|
113
|
+
renders all the original arguments except --drb
|
114
|
+
--drb specified in ARGV and the options file
|
115
|
+
renders all the original arguments except --drb
|
116
|
+
--drb specified in ARGV and in as ARGV-specified --options file
|
117
|
+
renders all the original arguments except --drb and --options
|
118
|
+
sources: ~/.rspec, ./.rspec, custom, CLI, and SPEC_OPTS
|
119
|
+
merges global, local, SPEC_OPTS, and CLI
|
120
|
+
prefers SPEC_OPTS over CLI
|
121
|
+
prefers CLI over file options
|
122
|
+
prefers local file options over global
|
123
|
+
with custom options file
|
124
|
+
ignores local and global options files
|
125
|
+
|
126
|
+
RSpec::Core::Configuration
|
127
|
+
#load_spec_files
|
128
|
+
loads files using load
|
129
|
+
with rspec-1 loaded
|
130
|
+
raises with a helpful message
|
131
|
+
#treat_symbols_as_metadata_keys_with_true_values?
|
132
|
+
defaults to false
|
133
|
+
can be set to true
|
134
|
+
#mock_framework
|
135
|
+
defaults to :rspec
|
136
|
+
#mock_framework=
|
137
|
+
uses the null adapter when set to any unknown key
|
138
|
+
with rspec
|
139
|
+
requires the adapter for :rspec
|
140
|
+
with mocha
|
141
|
+
requires the adapter for :mocha
|
142
|
+
with rr
|
143
|
+
requires the adapter for :rr
|
144
|
+
with flexmock
|
145
|
+
requires the adapter for :flexmock
|
146
|
+
with a module
|
147
|
+
sets the mock_framework_adapter to that module
|
148
|
+
#mock_with
|
149
|
+
delegates to mock_framework=
|
150
|
+
#expectation_framework
|
151
|
+
defaults to :rspec
|
152
|
+
#expectation_framework=
|
153
|
+
delegates to expect_with=
|
154
|
+
#expect_with
|
155
|
+
raises ArgumentError if framework is not supported
|
156
|
+
with rspec
|
157
|
+
requires the adapter for :rspec
|
158
|
+
with stdlib
|
159
|
+
requires the adapter for :stdlib
|
160
|
+
#expecting_with_rspec?
|
161
|
+
returns false by default
|
162
|
+
returns true when `expect_with :rspec` has been configured
|
163
|
+
returns true when `expect_with :rspec, :stdlib` has been configured
|
164
|
+
returns true when `expect_with :stdlib, :rspec` has been configured
|
165
|
+
returns false when `expect_with :stdlib` has been configured
|
166
|
+
setting the files to run
|
167
|
+
loads files not following pattern if named explicitly
|
168
|
+
with default --pattern
|
169
|
+
loads files named _spec.rb
|
170
|
+
loads files in Windows
|
171
|
+
with explicit pattern (single)
|
172
|
+
loads files following pattern
|
173
|
+
loads files in directories following pattern
|
174
|
+
does not load files in directories not following pattern
|
175
|
+
with explicit pattern (comma,separated,values)
|
176
|
+
supports comma separated values
|
177
|
+
supports comma separated values with spaces
|
178
|
+
with line number
|
179
|
+
assigns the line number as the filter
|
180
|
+
with full_description
|
181
|
+
overrides :focused
|
182
|
+
assigns the example name as the filter on description
|
183
|
+
#include
|
184
|
+
behaves like metadata hash builder
|
185
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
186
|
+
treats symbols as metadata keys with a true value
|
187
|
+
still processes hash values normally
|
188
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
189
|
+
prints a deprecation warning about any symbols given as arguments
|
190
|
+
does not treat symbols as metadata keys
|
191
|
+
does not print a warning if there are no symbol arguments
|
192
|
+
with no filter
|
193
|
+
includes the given module into each example group
|
194
|
+
with a filter
|
195
|
+
includes the given module into each matching example group
|
196
|
+
#extend
|
197
|
+
extends the given module into each matching example group
|
198
|
+
behaves like metadata hash builder
|
199
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
200
|
+
treats symbols as metadata keys with a true value
|
201
|
+
still processes hash values normally
|
202
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
203
|
+
prints a deprecation warning about any symbols given as arguments
|
204
|
+
does not treat symbols as metadata keys
|
205
|
+
does not print a warning if there are no symbol arguments
|
206
|
+
run_all_when_everything_filtered?
|
207
|
+
defaults to false
|
208
|
+
can be queried with question method
|
209
|
+
#color_enabled=
|
210
|
+
given true
|
211
|
+
with non-tty output and no autotest
|
212
|
+
does not set color_enabled
|
213
|
+
with tty output
|
214
|
+
does not set color_enabled
|
215
|
+
with tty set
|
216
|
+
does not set color_enabled
|
217
|
+
on windows
|
218
|
+
with ANSICON available
|
219
|
+
enables colors
|
220
|
+
leaves output stream intact
|
221
|
+
with ANSICON NOT available
|
222
|
+
warns to install ANSICON
|
223
|
+
sets color_enabled to false
|
224
|
+
formatter=
|
225
|
+
delegates to add_formatter (better API for user-facing configuration)
|
226
|
+
add_formatter
|
227
|
+
adds to the list of formatters
|
228
|
+
finds a formatter by name (w/ Symbol)
|
229
|
+
finds a formatter by name (w/ String)
|
230
|
+
finds a formatter by class
|
231
|
+
finds a formatter by class name
|
232
|
+
finds a formatter by class fully qualified name
|
233
|
+
requires a formatter file based on its fully qualified name
|
234
|
+
raises NameError if class is unresolvable
|
235
|
+
raises ArgumentError if formatter is unknown
|
236
|
+
with a 2nd arg defining the output
|
237
|
+
creates a file at that path and sets it as the output
|
238
|
+
#filter_run
|
239
|
+
sets the filter
|
240
|
+
merges with existing filters
|
241
|
+
warns if :line_number is already a filter
|
242
|
+
warns if :full_description is already a filter
|
243
|
+
behaves like metadata hash builder
|
244
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
245
|
+
treats symbols as metadata keys with a true value
|
246
|
+
still processes hash values normally
|
247
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
248
|
+
prints a deprecation warning about any symbols given as arguments
|
249
|
+
does not treat symbols as metadata keys
|
250
|
+
does not print a warning if there are no symbol arguments
|
251
|
+
#filter_run_excluding
|
252
|
+
sets the filter
|
253
|
+
merges with existing filters
|
254
|
+
behaves like metadata hash builder
|
255
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
256
|
+
treats symbols as metadata keys with a true value
|
257
|
+
still processes hash values normally
|
258
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
259
|
+
prints a deprecation warning about any symbols given as arguments
|
260
|
+
does not treat symbols as metadata keys
|
261
|
+
does not print a warning if there are no symbol arguments
|
262
|
+
#exclusion_filter
|
263
|
+
the default :if filter
|
264
|
+
does not exclude a spec with no :if metadata
|
265
|
+
does not exclude a spec with { :if => true } metadata
|
266
|
+
excludes a spec with { :if => false } metadata
|
267
|
+
excludes a spec with { :if => nil } metadata
|
268
|
+
the default :unless filter
|
269
|
+
excludes a spec with { :unless => true } metadata
|
270
|
+
does not exclude a spec with { :unless => false } metadata
|
271
|
+
does not exclude a spec with { :unless => nil } metadata
|
272
|
+
line_number=
|
273
|
+
sets the line number
|
274
|
+
overrides :focused
|
275
|
+
prevents :focused
|
276
|
+
#full_backtrace=
|
277
|
+
clears the backtrace clean patterns
|
278
|
+
doesn't impact other instances of config
|
279
|
+
#debug=true
|
280
|
+
requires 'ruby-debug'
|
281
|
+
starts the debugger
|
282
|
+
#debug=false
|
283
|
+
does not require 'ruby-debug'
|
284
|
+
#output=
|
285
|
+
sets the output
|
286
|
+
#libs=
|
287
|
+
adds directories to the LOAD_PATH
|
288
|
+
#requires=
|
289
|
+
requires paths
|
290
|
+
#add_setting
|
291
|
+
with no modifiers
|
292
|
+
with no additional options
|
293
|
+
defaults to nil
|
294
|
+
adds a predicate
|
295
|
+
can be overridden
|
296
|
+
with :default => 'a value'
|
297
|
+
defaults to 'a value'
|
298
|
+
returns true for the predicate
|
299
|
+
can be overridden with a truthy value
|
300
|
+
can be overridden with nil
|
301
|
+
can be overridden with false
|
302
|
+
with :alias =>
|
303
|
+
delegates the getter to the other option
|
304
|
+
delegates the setter to the other option
|
305
|
+
delegates the predicate to the other option
|
306
|
+
#configure_group
|
307
|
+
extends with 'extend'
|
308
|
+
extends with 'module'
|
309
|
+
requires only one matching filter
|
310
|
+
includes each one before deciding whether to include the next
|
311
|
+
#alias_example_to
|
312
|
+
behaves like metadata hash builder
|
313
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
314
|
+
treats symbols as metadata keys with a true value
|
315
|
+
still processes hash values normally
|
316
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
317
|
+
prints a deprecation warning about any symbols given as arguments
|
318
|
+
does not treat symbols as metadata keys
|
319
|
+
does not print a warning if there are no symbol arguments
|
320
|
+
|
321
|
+
deprecations
|
322
|
+
Spec
|
323
|
+
is deprecated
|
324
|
+
returns RSpec
|
325
|
+
doesn't include backward compatibility in const_missing backtrace
|
326
|
+
RSpec::Core::ExampleGroup
|
327
|
+
running_example
|
328
|
+
is deprecated
|
329
|
+
delegates to example
|
330
|
+
Spec::Runner.configure
|
331
|
+
is deprecated
|
332
|
+
Spec::Rake::SpecTask
|
333
|
+
is deprecated
|
334
|
+
doesn't include backward compatibility in const_missing backtrace
|
335
|
+
|
336
|
+
::DRbCommandLine
|
337
|
+
without server running
|
338
|
+
raises an error
|
339
|
+
--drb-port
|
340
|
+
without RSPEC_DRB environment variable set
|
341
|
+
defaults to 8989
|
342
|
+
sets the DRb port
|
343
|
+
with RSPEC_DRB environment variable set
|
344
|
+
without config variable set
|
345
|
+
uses RSPEC_DRB value
|
346
|
+
and config variable set
|
347
|
+
uses configured value
|
348
|
+
with server running
|
349
|
+
returns true
|
350
|
+
integrates via Runner.new.run
|
351
|
+
outputs green colorized text when running with --colour option (PENDING: figure out a way to properly sandbox this)
|
352
|
+
outputs red colorized text when running with -c option (PENDING: figure out a way to properly sandbox this)
|
353
|
+
|
354
|
+
RSpec::Core::ExampleGroup
|
355
|
+
behaves like metadata hash builder
|
356
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
357
|
+
treats symbols as metadata keys with a true value
|
358
|
+
still processes hash values normally
|
359
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
360
|
+
prints a deprecation warning about any symbols given as arguments
|
361
|
+
does not treat symbols as metadata keys
|
362
|
+
does not print a warning if there are no symbol arguments
|
363
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
364
|
+
processes string args as part of the description
|
365
|
+
processes symbol args as part of the description
|
366
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
367
|
+
does not treat the first argument as a metadata key even if it is a symbol
|
368
|
+
treats the first argument as part of the description when it is a symbol
|
369
|
+
top level group
|
370
|
+
runs its children
|
371
|
+
with a failure in the top level group
|
372
|
+
runs its children
|
373
|
+
descendants
|
374
|
+
returns self + all descendants
|
375
|
+
child
|
376
|
+
is known by parent
|
377
|
+
is not registered in world
|
378
|
+
filtering
|
379
|
+
includes all examples in an explicitly included group
|
380
|
+
includes explicitly included examples
|
381
|
+
excludes all examples in an excluded group
|
382
|
+
filters out excluded examples
|
383
|
+
with no filters
|
384
|
+
returns all
|
385
|
+
with no examples or groups that match filters
|
386
|
+
returns none
|
387
|
+
#describes
|
388
|
+
with a constant as the first parameter
|
389
|
+
is that constant
|
390
|
+
with a string as the first parameter
|
391
|
+
is nil
|
392
|
+
with a constant in an outer group
|
393
|
+
and a string in an inner group
|
394
|
+
is the top level constant
|
395
|
+
in a nested group
|
396
|
+
inherits the described class/module from the outer group
|
397
|
+
#described_class
|
398
|
+
is the same as describes
|
399
|
+
#description
|
400
|
+
grabs the description from the metadata
|
401
|
+
#metadata
|
402
|
+
adds the third parameter to the metadata
|
403
|
+
adds the the file_path to metadata
|
404
|
+
has a reader for file_path
|
405
|
+
adds the line_number to metadata
|
406
|
+
#focus
|
407
|
+
defines an example that can be filtered with :focused => true
|
408
|
+
defines an example that can be filtered with :focus => true
|
409
|
+
#focused
|
410
|
+
defines an example that can be filtered with :focused => true
|
411
|
+
defines an example that can be filtered with :focus => true
|
412
|
+
#before, after, and around hooks
|
413
|
+
runs the before alls in order
|
414
|
+
runs the before eachs in order
|
415
|
+
runs the after eachs in reverse order
|
416
|
+
runs the after alls in reverse order
|
417
|
+
only runs before/after(:all) hooks from example groups that have specs that run
|
418
|
+
runs before_all_defined_in_config, before all, before each, example, after each, after all, after_all_defined_in_config in that order
|
419
|
+
treats an error in before(:each) as a failure
|
420
|
+
treats an error in before(:all) as a failure
|
421
|
+
treats an error in before(:all) as a failure for a spec in a nested group
|
422
|
+
has no 'running example' within before(:all)
|
423
|
+
has access to example options within before(:each)
|
424
|
+
has access to example options within after(:each)
|
425
|
+
has no 'running example' within after(:all)
|
426
|
+
after(:all)
|
427
|
+
has access to state defined before(:all)
|
428
|
+
cleans up ivars in after(:all)
|
429
|
+
when an error occurs in an after(:all) hook
|
430
|
+
allows the example to pass
|
431
|
+
rescues the error and prints it out
|
432
|
+
adding examples
|
433
|
+
allows adding an example using 'it'
|
434
|
+
allows adding a pending example using 'xit'
|
435
|
+
exposes all examples at examples
|
436
|
+
maintains the example order
|
437
|
+
Object describing nested example_groups
|
438
|
+
A sample nested group
|
439
|
+
sets the described class to the described class of the outer most group
|
440
|
+
sets the description to 'A sample nested describe'
|
441
|
+
has top level metadata from the example_group and its ancestors
|
442
|
+
exposes the parent metadata to the contained examples
|
443
|
+
#run_examples
|
444
|
+
returns true if all examples pass
|
445
|
+
returns false if any of the examples fail
|
446
|
+
runs all examples, regardless of any of them failing
|
447
|
+
how instance variables are inherited
|
448
|
+
can access a before each ivar at the same level
|
449
|
+
can access a before all ivar at the same level
|
450
|
+
can access the before all ivars in the before_all_ivars hash
|
451
|
+
but now I am nested
|
452
|
+
can access a parent example groups before each ivar at a nested level
|
453
|
+
can access a parent example groups before all ivar at a nested level
|
454
|
+
changes to before all ivars from within an example do not persist outside the current describe
|
455
|
+
accessing a before_all ivar that was changed in a parent example_group
|
456
|
+
does not have access to the modified version
|
457
|
+
ivars are not shared across examples
|
458
|
+
(first example)
|
459
|
+
(second example)
|
460
|
+
#top_level_description
|
461
|
+
returns the description from the outermost example group
|
462
|
+
#run
|
463
|
+
with fail_fast? => true
|
464
|
+
does not run examples after the failed example
|
465
|
+
with RSpec.wants_to_quit=true
|
466
|
+
returns without starting the group
|
467
|
+
at top level
|
468
|
+
purges remaining groups
|
469
|
+
in a nested group
|
470
|
+
does not purge remaining groups
|
471
|
+
with all examples passing
|
472
|
+
returns true
|
473
|
+
with top level example failing
|
474
|
+
returns false
|
475
|
+
with nested example failing
|
476
|
+
returns true
|
477
|
+
#include_context
|
478
|
+
includes the named context
|
479
|
+
|
480
|
+
RSpec::Core::Example
|
481
|
+
behaves like metadata hash builder
|
482
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
483
|
+
treats symbols as metadata keys with a true value
|
484
|
+
still processes hash values normally
|
485
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
486
|
+
prints a deprecation warning about any symbols given as arguments
|
487
|
+
does not treat symbols as metadata keys
|
488
|
+
does not print a warning if there are no symbol arguments
|
489
|
+
auto-generated example descriptions
|
490
|
+
when `expect_with :rspec` is configured
|
491
|
+
generates a description for an example with no description
|
492
|
+
when `expect_with :rspec, :stdlib` is configured
|
493
|
+
generates a description for an example with no description
|
494
|
+
when `expect_with :stdlib` is configured
|
495
|
+
does not attempt to get the generated description from RSpec::Matchers
|
496
|
+
fails an example with no description
|
497
|
+
#described_class
|
498
|
+
returns the class (if any) of the outermost example group
|
499
|
+
accessing metadata within a running example
|
500
|
+
has a reference to itself when running
|
501
|
+
can access the example group's top level metadata as if it were its own
|
502
|
+
accessing options within a running example
|
503
|
+
can look up option values by key
|
504
|
+
#run
|
505
|
+
sets its reference to the example group instance to nil
|
506
|
+
runs after(:each) when the example passes
|
507
|
+
runs after(:each) when the example fails
|
508
|
+
runs after(:each) when the example raises an Exception
|
509
|
+
wraps before/after(:each) inside around
|
510
|
+
with an after(:each) that raises
|
511
|
+
runs subsequent after(:each)'s
|
512
|
+
stores the exception
|
513
|
+
clearing ivars
|
514
|
+
sets ivars to nil to prep them for GC
|
515
|
+
does not impact the before_all_ivars which are copied to each example
|
516
|
+
#pending
|
517
|
+
in the example
|
518
|
+
sets the example to pending
|
519
|
+
allows post-example processing in around hooks (see https://github.com/rspec/rspec-core/issues/322)
|
520
|
+
in before(:each)
|
521
|
+
sets each example to pending
|
522
|
+
in before(:all)
|
523
|
+
sets each example to pending
|
524
|
+
in around(:each)
|
525
|
+
sets the example to pending
|
526
|
+
|
527
|
+
RSpec::Core::Formatters::BaseFormatter
|
528
|
+
backtrace_line
|
529
|
+
trims current working directory
|
530
|
+
leaves the original line intact
|
531
|
+
read_failed_line
|
532
|
+
deals gracefully with a heterogeneous language stack trace
|
533
|
+
when String alias to_int to_i
|
534
|
+
doesn't hang when file exists
|
535
|
+
#format_backtrace
|
536
|
+
removes lines from rspec and lines that come before the invocation of the at_exit autorun hook
|
537
|
+
|
538
|
+
RSpec::Core::Formatters::BaseTextFormatter
|
539
|
+
#summary_line
|
540
|
+
with 0s
|
541
|
+
outputs pluralized (excluding pending)
|
542
|
+
with 1s
|
543
|
+
outputs singular (including pending)
|
544
|
+
with 2s
|
545
|
+
outputs pluralized (including pending)
|
546
|
+
#dump_failures
|
547
|
+
preserves formatting
|
548
|
+
with an exception without a message
|
549
|
+
does not throw NoMethodError
|
550
|
+
with an exception class other than RSpec
|
551
|
+
does not show the error class
|
552
|
+
with a failed expectation (rspec-expectations)
|
553
|
+
does not show the error class
|
554
|
+
with a failed message expectation (rspec-mocks)
|
555
|
+
does not show the error class
|
556
|
+
for #share_examples_for
|
557
|
+
outputs the name and location
|
558
|
+
that contains nested example groups
|
559
|
+
outputs the name and location
|
560
|
+
for #share_as
|
561
|
+
outputs the name and location
|
562
|
+
that contains nested example groups
|
563
|
+
outputs the name and location
|
564
|
+
#dump_profile
|
565
|
+
names the example
|
566
|
+
prints the time
|
567
|
+
prints the path
|
568
|
+
|
569
|
+
RSpec::Core::Formatters::DocumentationFormatter
|
570
|
+
numbers the failures
|
571
|
+
represents nested group using hierarchy tree
|
572
|
+
|
573
|
+
RSpec::Core::Formatters::Helpers
|
574
|
+
format seconds
|
575
|
+
sub second times
|
576
|
+
returns 5 digits of precision
|
577
|
+
strips off trailing zeroes beyond sub-second precision
|
578
|
+
0
|
579
|
+
strips off trailing zeroes
|
580
|
+
> 1
|
581
|
+
strips off trailing zeroes
|
582
|
+
second and greater times
|
583
|
+
returns 2 digits of precision
|
584
|
+
returns human friendly elasped time
|
585
|
+
|
586
|
+
RSpec::Core::Formatters::HtmlFormatter
|
587
|
+
produces HTML identical to the one we designed manually
|
588
|
+
|
589
|
+
RSpec::Core::Formatters::ProgressFormatter
|
590
|
+
produces line break on start dump
|
591
|
+
produces standard summary without pending when pending has a 0 count
|
592
|
+
pushes nothing on start
|
593
|
+
|
594
|
+
RSpec::Core::Formatters::SnippetExtractor
|
595
|
+
falls back on a default message when it doesn't understand a line
|
596
|
+
falls back on a default message when it doesn't find the file
|
597
|
+
|
598
|
+
RSpec::Core::Formatters::TextMateFormatter
|
599
|
+
produces HTML identical to the one we designed manually
|
600
|
+
has a backtrace line from the raw erb evaluation
|
601
|
+
has a backtrace line from a erb source file we forced to appear
|
602
|
+
|
603
|
+
config block hook filtering
|
604
|
+
unfiltered hooks
|
605
|
+
should be ran
|
606
|
+
hooks with single filters
|
607
|
+
should be ran if the filter matches the example group's filter
|
608
|
+
runs before|after :all hooks on matching nested example groups
|
609
|
+
runs before|after :all hooks only on the highest level group that matches the filter
|
610
|
+
should not be ran if the filter doesn't match the example group's filter
|
611
|
+
with no scope specified
|
612
|
+
should be ran around|before|after :each if the filter matches the example group's filter
|
613
|
+
when the hook filters apply to individual examples instead of example groups
|
614
|
+
an example with matching metadata
|
615
|
+
runs the `:each` hooks
|
616
|
+
does not run the `:all` hooks
|
617
|
+
an example without matching metadata
|
618
|
+
does not run any of the hooks
|
619
|
+
hooks with multiple filters
|
620
|
+
should be ran if all hook filters match the group's filters
|
621
|
+
should not be ran if some hook filters don't match the group's filters
|
622
|
+
|
623
|
+
RSpec::Core::Hooks
|
624
|
+
#before(each)
|
625
|
+
behaves like metadata hash builder
|
626
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
627
|
+
treats symbols as metadata keys with a true value
|
628
|
+
still processes hash values normally
|
629
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
630
|
+
prints a deprecation warning about any symbols given as arguments
|
631
|
+
does not treat symbols as metadata keys
|
632
|
+
does not print a warning if there are no symbol arguments
|
633
|
+
#before(all)
|
634
|
+
behaves like metadata hash builder
|
635
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
636
|
+
treats symbols as metadata keys with a true value
|
637
|
+
still processes hash values normally
|
638
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
639
|
+
prints a deprecation warning about any symbols given as arguments
|
640
|
+
does not treat symbols as metadata keys
|
641
|
+
does not print a warning if there are no symbol arguments
|
642
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
643
|
+
#before(no scope)
|
644
|
+
defaults to :each scope if no arguments are given
|
645
|
+
defaults to :each scope if the only argument is a metadata hash
|
646
|
+
raises an error if only metadata symbols are given as arguments
|
647
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
648
|
+
#before(no scope)
|
649
|
+
defaults to :each scope if no arguments are given
|
650
|
+
defaults to :each scope if the only argument is a metadata hash
|
651
|
+
raises an error if only metadata symbols are given as arguments
|
652
|
+
#after(each)
|
653
|
+
behaves like metadata hash builder
|
654
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
655
|
+
treats symbols as metadata keys with a true value
|
656
|
+
still processes hash values normally
|
657
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
658
|
+
prints a deprecation warning about any symbols given as arguments
|
659
|
+
does not treat symbols as metadata keys
|
660
|
+
does not print a warning if there are no symbol arguments
|
661
|
+
#after(all)
|
662
|
+
behaves like metadata hash builder
|
663
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
664
|
+
treats symbols as metadata keys with a true value
|
665
|
+
still processes hash values normally
|
666
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
667
|
+
prints a deprecation warning about any symbols given as arguments
|
668
|
+
does not treat symbols as metadata keys
|
669
|
+
does not print a warning if there are no symbol arguments
|
670
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
671
|
+
#after(no scope)
|
672
|
+
defaults to :each scope if no arguments are given
|
673
|
+
defaults to :each scope if the only argument is a metadata hash
|
674
|
+
raises an error if only metadata symbols are given as arguments
|
675
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
676
|
+
#after(no scope)
|
677
|
+
defaults to :each scope if no arguments are given
|
678
|
+
defaults to :each scope if the only argument is a metadata hash
|
679
|
+
raises an error if only metadata symbols are given as arguments
|
680
|
+
#around(each)
|
681
|
+
behaves like metadata hash builder
|
682
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
683
|
+
treats symbols as metadata keys with a true value
|
684
|
+
still processes hash values normally
|
685
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
686
|
+
prints a deprecation warning about any symbols given as arguments
|
687
|
+
does not treat symbols as metadata keys
|
688
|
+
does not print a warning if there are no symbol arguments
|
689
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
690
|
+
#around(no scope)
|
691
|
+
defaults to :each scope if no arguments are given
|
692
|
+
defaults to :each scope if the only argument is a metadata hash
|
693
|
+
raises an error if only metadata symbols are given as arguments
|
694
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
695
|
+
#around(no scope)
|
696
|
+
defaults to :each scope if no arguments are given
|
697
|
+
defaults to :each scope if the only argument is a metadata hash
|
698
|
+
raises an error if only metadata symbols are given as arguments
|
699
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
700
|
+
#before(:each)
|
701
|
+
does not make :each a metadata key
|
702
|
+
is scoped to :each
|
703
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
704
|
+
#before(:each)
|
705
|
+
does not make :each a metadata key
|
706
|
+
is scoped to :each
|
707
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
708
|
+
#before(:all)
|
709
|
+
does not make :all a metadata key
|
710
|
+
is scoped to :all
|
711
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
712
|
+
#before(:all)
|
713
|
+
does not make :all a metadata key
|
714
|
+
is scoped to :all
|
715
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
716
|
+
#before(:suite)
|
717
|
+
does not make :suite a metadata key
|
718
|
+
is scoped to :suite
|
719
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
720
|
+
#before(:suite)
|
721
|
+
does not make :suite a metadata key
|
722
|
+
is scoped to :suite
|
723
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
724
|
+
#after(:each)
|
725
|
+
does not make :each a metadata key
|
726
|
+
is scoped to :each
|
727
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
728
|
+
#after(:each)
|
729
|
+
does not make :each a metadata key
|
730
|
+
is scoped to :each
|
731
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
732
|
+
#after(:all)
|
733
|
+
does not make :all a metadata key
|
734
|
+
is scoped to :all
|
735
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
736
|
+
#after(:all)
|
737
|
+
does not make :all a metadata key
|
738
|
+
is scoped to :all
|
739
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
|
740
|
+
#after(:suite)
|
741
|
+
does not make :suite a metadata key
|
742
|
+
is scoped to :suite
|
743
|
+
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
|
744
|
+
#after(:suite)
|
745
|
+
does not make :suite a metadata key
|
746
|
+
is scoped to :suite
|
747
|
+
#around
|
748
|
+
when not running the example within the around block
|
749
|
+
does not run the example
|
750
|
+
when running the example within the around block
|
751
|
+
runs the example
|
752
|
+
when running the example within a block passed to a method
|
753
|
+
runs the example
|
754
|
+
RSpec::Core::Hooks::Hook
|
755
|
+
requires a block
|
756
|
+
|
757
|
+
extensions
|
758
|
+
debugger
|
759
|
+
is defined on Kernel
|
760
|
+
|
761
|
+
#let
|
762
|
+
generates an instance method
|
763
|
+
caches the value
|
764
|
+
|
765
|
+
#let!
|
766
|
+
evaluates the value non-lazily
|
767
|
+
does not interfere between tests
|
768
|
+
|
769
|
+
RSpec::Core::Metadata
|
770
|
+
#process
|
771
|
+
prohibits :description as a hash key
|
772
|
+
prohibits :example_group as a hash key
|
773
|
+
prohibits :execution_result as a hash key
|
774
|
+
prohibits :file_path as a hash key
|
775
|
+
prohibits :full_description as a hash key
|
776
|
+
prohibits :line_number as a hash key
|
777
|
+
prohibits :location as a hash key
|
778
|
+
uses :caller if passed as part of the user metadata
|
779
|
+
#apply_condition
|
780
|
+
matches the group when the line_number is the example group line number
|
781
|
+
matches the example when the line_number is the grandparent example group line number
|
782
|
+
matches the example when the line_number is the parent example group line number
|
783
|
+
matches the example when the line_number is the example line number
|
784
|
+
matches when the line number is between this example and the next
|
785
|
+
does not match when the line number matches the next example
|
786
|
+
matches a proc that evaluates to true
|
787
|
+
does not match a proc that evaluates to false
|
788
|
+
passes the metadata hash as the second argument if a given proc expects 2 args
|
789
|
+
#for_example
|
790
|
+
stores the description
|
791
|
+
stores the full_description (group description + example description)
|
792
|
+
creates an empty execution result
|
793
|
+
extracts file path from caller
|
794
|
+
extracts line number from caller
|
795
|
+
extracts location from caller
|
796
|
+
uses :caller if passed as an option
|
797
|
+
merges arbitrary options
|
798
|
+
points :example_group to the same hash object
|
799
|
+
:describes
|
800
|
+
with a String
|
801
|
+
returns nil
|
802
|
+
with a Symbol
|
803
|
+
returns nil
|
804
|
+
with a class
|
805
|
+
returns the class
|
806
|
+
with describes from a superclass metadata
|
807
|
+
returns the superclass' described class
|
808
|
+
:description
|
809
|
+
just has the example description
|
810
|
+
with a string
|
811
|
+
provides the submitted description
|
812
|
+
with a non-string
|
813
|
+
provides the submitted description
|
814
|
+
with a non-string and a string
|
815
|
+
concats the args
|
816
|
+
:full_description
|
817
|
+
concats example group name and description
|
818
|
+
concats nested example group descriptions
|
819
|
+
with a 2nd arg starting with #
|
820
|
+
removes the space
|
821
|
+
with a 2nd arg starting with .
|
822
|
+
removes the space
|
823
|
+
with a 2nd arg starting with ::
|
824
|
+
removes the space
|
825
|
+
with a nested description starting with #
|
826
|
+
removes the space
|
827
|
+
with a nested description starting with .
|
828
|
+
removes the space
|
829
|
+
with a nested description starting with ::
|
830
|
+
removes the space
|
831
|
+
:file_path
|
832
|
+
finds the first non-rspec lib file in the caller array
|
833
|
+
:line_number
|
834
|
+
finds the line number with the first non-rspec lib file in the backtrace
|
835
|
+
finds the line number with the first spec file with drive letter
|
836
|
+
uses the number after the first : for ruby 1.9
|
837
|
+
child example group
|
838
|
+
nests the parent's example group metadata
|
839
|
+
|
840
|
+
OptionParser
|
841
|
+
does not parse empty args
|
842
|
+
--formatter
|
843
|
+
is deprecated
|
844
|
+
gets converted to --format
|
845
|
+
--format
|
846
|
+
defines the formatter
|
847
|
+
-f
|
848
|
+
defines the formatter
|
849
|
+
--out
|
850
|
+
sets the output stream for the formatter
|
851
|
+
with multiple formatters
|
852
|
+
after last formatter
|
853
|
+
sets the output stream for the last formatter
|
854
|
+
after first formatter
|
855
|
+
sets the output stream for the first formatter
|
856
|
+
-o
|
857
|
+
sets the output stream for the formatter
|
858
|
+
with multiple formatters
|
859
|
+
after last formatter
|
860
|
+
sets the output stream for the last formatter
|
861
|
+
after first formatter
|
862
|
+
sets the output stream for the first formatter
|
863
|
+
--example
|
864
|
+
escapes the arg
|
865
|
+
|
866
|
+
an example
|
867
|
+
with no block
|
868
|
+
is listed as pending with 'Not Yet Implemented'
|
869
|
+
with no args
|
870
|
+
is listed as pending with the default message
|
871
|
+
with no docstring
|
872
|
+
declared with the pending method
|
873
|
+
does not have an auto-generated description
|
874
|
+
after another example with some assertion
|
875
|
+
does not show any message
|
876
|
+
with a message
|
877
|
+
is listed as pending with the supplied message
|
878
|
+
with a block
|
879
|
+
that fails
|
880
|
+
when given no options
|
881
|
+
is listed as pending with the supplied message
|
882
|
+
is listed as pending with the default message when no message is given
|
883
|
+
when given a truthy :if option
|
884
|
+
is listed as pending with the supplied message
|
885
|
+
is listed as pending with the default message when no message is given
|
886
|
+
when given a falsey :if option
|
887
|
+
runs the example and fails
|
888
|
+
when given a truthy :unless option
|
889
|
+
runs the example and fails
|
890
|
+
when given a falsey :unless option
|
891
|
+
is listed as pending with the supplied message
|
892
|
+
is listed as pending with the default message when no message is given
|
893
|
+
that passes
|
894
|
+
when given no options
|
895
|
+
fails with a PendingExampleFixedError
|
896
|
+
when given a truthy :if option
|
897
|
+
fails with a PendingExampleFixedError
|
898
|
+
when given a falsey :if option
|
899
|
+
runs the example and it passes
|
900
|
+
when given a truthy :unless option
|
901
|
+
runs the example and it passes
|
902
|
+
when given a falsey :unless option
|
903
|
+
fails with a PendingExampleFixedError
|
904
|
+
|
905
|
+
RSpec::Core::RakeTask
|
906
|
+
default
|
907
|
+
renders rspec
|
908
|
+
with bundler
|
909
|
+
with Gemfile
|
910
|
+
renders bundle exec rspec
|
911
|
+
with non-standard Gemfile
|
912
|
+
renders bundle exec rspec
|
913
|
+
without Gemfile
|
914
|
+
renders bundle exec rspec
|
915
|
+
with rcov
|
916
|
+
renders rcov
|
917
|
+
with bundler and rcov
|
918
|
+
renders bundle exec rcov
|
919
|
+
with ruby options
|
920
|
+
renders them before -S
|
921
|
+
with rcov_opts
|
922
|
+
with rcov=false (default)
|
923
|
+
does not add the rcov options to the command
|
924
|
+
with rcov=true
|
925
|
+
renders them after rcov
|
926
|
+
ensures that -Ispec:lib is in the resulting command
|
927
|
+
with rspec_opts
|
928
|
+
with rcov=true
|
929
|
+
adds the rspec_opts after the rcov_opts and files
|
930
|
+
with rcov=false (default)
|
931
|
+
adds the rspec_opts
|
932
|
+
with SPEC=path/to/file
|
933
|
+
sets files to run
|
934
|
+
with paths with quotes
|
935
|
+
escapes the quotes
|
936
|
+
|
937
|
+
RSpec::Core::Reporter
|
938
|
+
abort
|
939
|
+
sends start_dump to the formatter(s)
|
940
|
+
sends dump_pending to the formatter(s)
|
941
|
+
sends dump_failures to the formatter(s)
|
942
|
+
sends dump_summary to the formatter(s)
|
943
|
+
sends close to the formatter(s)
|
944
|
+
given one formatter
|
945
|
+
passes messages to that formatter
|
946
|
+
passes example_group_started and example_group_finished messages to that formatter in that order
|
947
|
+
given an example group with no examples
|
948
|
+
does not pass example_group_started or example_group_finished to formatter
|
949
|
+
given multiple formatters
|
950
|
+
passes messages to all formatters
|
951
|
+
|
952
|
+
RSpec::Matchers
|
953
|
+
behaves like a normal module with a method that supers
|
954
|
+
raises the expected error (and not SystemStackError)
|
955
|
+
when RSpec::Matchers has been included in an example group
|
956
|
+
behaves like a normal module with a method that supers
|
957
|
+
raises the expected error (and not SystemStackError)
|
958
|
+
when a module that includes RSpec::Matchers has been included in an example group
|
959
|
+
behaves like a normal module with a method that supers
|
960
|
+
raises the expected error (and not SystemStackError)
|
961
|
+
when RSpec::Matchers is included via configuration
|
962
|
+
behaves like a normal module with a method that supers
|
963
|
+
raises the expected error (and not SystemStackError)
|
964
|
+
when RSpec::Matchers is included in a module that is included via configuration
|
965
|
+
behaves like a normal module with a method that supers
|
966
|
+
raises the expected error (and not SystemStackError)
|
967
|
+
|
968
|
+
RSpec::Core::RubyProject
|
969
|
+
#determine_root
|
970
|
+
with ancestor containing spec directory
|
971
|
+
returns ancestor containing the spec directory
|
972
|
+
without ancestor containing spec directory
|
973
|
+
returns current working directory
|
974
|
+
|
975
|
+
RSpec::Core::Runner
|
976
|
+
at_exit
|
977
|
+
sets an at_exit hook if none is already set
|
978
|
+
does not set the at_exit hook if it is already set
|
979
|
+
#run
|
980
|
+
with --drb or -X
|
981
|
+
and a DRb server is running
|
982
|
+
builds a DRbCommandLine and runs the specs
|
983
|
+
and a DRb server is not running
|
984
|
+
outputs a message
|
985
|
+
builds a CommandLine and runs the specs
|
986
|
+
|
987
|
+
RSpec::Core::SharedContext
|
988
|
+
hooks
|
989
|
+
creates a before hook
|
990
|
+
|
991
|
+
RSpec::Core::SharedExampleGroup
|
992
|
+
share_examples_for
|
993
|
+
is exposed to the global namespace
|
994
|
+
raises an ArgumentError when adding a second shared example group with the same name
|
995
|
+
given a string
|
996
|
+
captures the given string and block in the World's collection of shared example groups
|
997
|
+
given a symbol
|
998
|
+
captures the given symbol and block in the World's collection of shared example groups
|
999
|
+
given a hash
|
1000
|
+
delegates extend on configuration
|
1001
|
+
given a string and a hash
|
1002
|
+
captures the given string and block in the World's collection of shared example groups
|
1003
|
+
delegates extend on configuration
|
1004
|
+
shared_examples_for
|
1005
|
+
is exposed to the global namespace
|
1006
|
+
raises an ArgumentError when adding a second shared example group with the same name
|
1007
|
+
given a string
|
1008
|
+
captures the given string and block in the World's collection of shared example groups
|
1009
|
+
given a symbol
|
1010
|
+
captures the given symbol and block in the World's collection of shared example groups
|
1011
|
+
given a hash
|
1012
|
+
delegates extend on configuration
|
1013
|
+
given a string and a hash
|
1014
|
+
captures the given string and block in the World's collection of shared example groups
|
1015
|
+
delegates extend on configuration
|
1016
|
+
#it_should_behave_like
|
1017
|
+
creates a nested group
|
1018
|
+
adds shared examples to nested group
|
1019
|
+
adds shared instance methods to nested group
|
1020
|
+
adds shared class methods to nested group
|
1021
|
+
raises when named shared example_group can not be found
|
1022
|
+
given some parameters
|
1023
|
+
passes the parameters to the shared example group
|
1024
|
+
adds shared instance methods to nested group
|
1025
|
+
evals the shared example group only once
|
1026
|
+
given a block
|
1027
|
+
evaluates the block in nested group
|
1028
|
+
#share_as
|
1029
|
+
is exposed to the global namespace
|
1030
|
+
adds examples to current example_group using include
|
1031
|
+
|
1032
|
+
RSpec::Core::Subject
|
1033
|
+
implicit subject
|
1034
|
+
with a class
|
1035
|
+
returns an instance of the class
|
1036
|
+
with a Module
|
1037
|
+
returns the Module
|
1038
|
+
with a string
|
1039
|
+
return the string
|
1040
|
+
with a number
|
1041
|
+
returns the number
|
1042
|
+
explicit subject
|
1043
|
+
with a value of false
|
1044
|
+
is evaluated once per example
|
1045
|
+
with a value of nil
|
1046
|
+
is evaluated once per example
|
1047
|
+
defined in a top level group
|
1048
|
+
replaces the implicit subject in that group
|
1049
|
+
defined in a top level group
|
1050
|
+
is available in a nested group (subclass)
|
1051
|
+
is available in a doubly nested group (subclass)
|
1052
|
+
using 'self' as an explicit subject
|
1053
|
+
delegates matcher to the ExampleGroup
|
1054
|
+
#its
|
1055
|
+
with a call counter
|
1056
|
+
call_count
|
1057
|
+
should == 1
|
1058
|
+
with nil value
|
1059
|
+
nil_value
|
1060
|
+
should be nil
|
1061
|
+
with nested attributes
|
1062
|
+
name
|
1063
|
+
should == John
|
1064
|
+
name.size
|
1065
|
+
should == 4
|
1066
|
+
name.size.class
|
1067
|
+
should == Fixnum
|
1068
|
+
when it responds to #[]
|
1069
|
+
[:a]
|
1070
|
+
should == "Symbol: a"
|
1071
|
+
["a"]
|
1072
|
+
should == "String: a"
|
1073
|
+
[:b, "c", 4]
|
1074
|
+
should == "Symbol: b; String: c; Fixnum: 4"
|
1075
|
+
name
|
1076
|
+
|
1077
|
+
when referring to an attribute without the proper array syntax
|
1078
|
+
it raises an error
|
1079
|
+
age
|
1080
|
+
should raise NoMethodError
|
1081
|
+
when it does not respond to #[]
|
1082
|
+
it raises an error
|
1083
|
+
[:a]
|
1084
|
+
should raise NoMethodError
|
1085
|
+
calling and overriding super
|
1086
|
+
calls to the subject defined in the parent group
|
1087
|
+
|
1088
|
+
RSpec::Core::World
|
1089
|
+
#example_groups
|
1090
|
+
contains all registered example groups
|
1091
|
+
#apply_inclusion_filters
|
1092
|
+
finds no groups when given no search parameters
|
1093
|
+
finds matching groups when filtering on :describes (described class or module)
|
1094
|
+
finds matching groups when filtering on :description with text
|
1095
|
+
finds matching groups when filtering on :description with a lambda
|
1096
|
+
finds matching groups when filtering on :description with a regular expression
|
1097
|
+
finds one group when searching for :pending => true
|
1098
|
+
finds matching groups when filtering on arbitrary metadata with a number
|
1099
|
+
finds matching groups when filtering on arbitrary metadata with an array
|
1100
|
+
finds no groups when filtering on arbitrary metadata with an array but the arrays do not match
|
1101
|
+
finds matching examples when filtering on arbitrary metadata
|
1102
|
+
finds matching examples for example that match any of the filters
|
1103
|
+
#apply_exclusion_filters
|
1104
|
+
finds nothing if all describes match the exclusion filter
|
1105
|
+
finds nothing if a regexp matches the exclusion filter
|
1106
|
+
#preceding_declaration_line (again)
|
1107
|
+
with one example
|
1108
|
+
returns nil if no example or group precedes the line
|
1109
|
+
returns the argument line number if a group starts on that line
|
1110
|
+
returns the argument line number if an example starts on that line
|
1111
|
+
returns line number of a group that immediately precedes the argument line
|
1112
|
+
returns line number of an example that immediately precedes the argument line
|
1113
|
+
with two exaples and the second example is registre first
|
1114
|
+
return line number of group if a group start on that line
|
1115
|
+
|
1116
|
+
RSpec::Core
|
1117
|
+
#configuration
|
1118
|
+
returns the same object every time
|
1119
|
+
#configure
|
1120
|
+
yields the current configuration
|
1121
|
+
when an example group has already been defined
|
1122
|
+
prints a deprecation warning
|
1123
|
+
when no examples have been defined yet
|
1124
|
+
does not print a deprecation warning
|
1125
|
+
#world
|
1126
|
+
returns the RSpec::Core::World instance the current run is using
|