forked from rspec/rspec-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
spec.txt
1126 lines (1089 loc) · 43 KB
/
spec.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
autotest/discover.rb
with /.rspec present
adds 'rspec2' to the list of discoveries
with /.rspec absent
does not add 'rspec2' to the list of discoveries
failed_results_re for autotest
output does not have color enabled
matches a failure
output has color enabled
matches a failure
Autotest::Rspec2
uses autotest's prefix
commands
makes the appropriate test command
returns a blank command for no files
quotes the paths of files to test
gives '--tty' to /Users/david/projects/ruby/rspec2/repos/rspec-core/bin/rspec, not '--autotest'
mappings
finds the spec file for a given lib file
finds the spec file if given a spec file
ignores files in spec dir that aren't specs
ignores untracked files (in @file)
consolidating failures
returns no failures if no failures were given in the output
returns a hash with the spec filename => spec name for each failure or error
when subject file appears before the spec file in the backtrace
excludes the subject file
includes the spec file
normalizing file names
ensures that a single file appears in files_to_test only once
RSpec::Core::CommandLineConfiguration
#run
given autotest command
calls Autotest.generate
given unsupported command
raises ArgumentError
RSpec::Core::CommandLine
given an Array of options
assigns ConfigurationOptions built from Array to @options
given a ConfigurationOptions object
assigns it to @options
#run
configures streams before command line options
runs before suite hooks
runs after suite hooks
runs after suite hooks even after an error
#run with custom output
doesn't override output_stream
RSpec::Core::ConfigurationOptions
#configure
sends libs before requires
sends requires before formatter
-c, --color, and --colour
sets :color_enabled => true
--no-color
sets :color_enabled => false
-I
adds to :libs
can be used more than once
--require
requires files
can be used more than once
--format, -f
sets :formatter
can accept a class name
--profile, -p
sets :profile_examples => true
--line_number
sets :line_number
--example
sets :full_description
--backtrace, -b
sets full_backtrace on config
--debug, -d
sets :debug => true
--fail-fast
defaults to false
sets fail_fast on config
--options
sets :custom_options_file
--drb, -X
does not send --drb back to the parser after parsing options
combined with --debug
turns off the debugger if --drb is specified first
turns off the debugger option if --drb is specified later
turns off the debugger option if --drb is specified in the options file
turns off the debugger option if --debug is specified in the options file
files_or_directories_to_run
parses files from '-c file.rb dir/file.rb'
parses dir from 'dir'
parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'
provides no files or directories if spec directory does not exist
parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'
#drb_argv
preserves extra arguments
includes --fail-fast
includes --options
with tags
includes the tags
leaves tags intact
with formatters
includes the formatters
leaves formatters intact
leaves output intact
--drb specified in ARGV
renders all the original arguments except --drb
--drb specified in the options file
renders all the original arguments except --drb
--drb specified in ARGV and the options file
renders all the original arguments except --drb
--drb specified in ARGV and in as ARGV-specified --options file
renders all the original arguments except --drb and --options
sources: ~/.rspec, ./.rspec, custom, CLI, and SPEC_OPTS
merges global, local, SPEC_OPTS, and CLI
prefers SPEC_OPTS over CLI
prefers CLI over file options
prefers local file options over global
with custom options file
ignores local and global options files
RSpec::Core::Configuration
#load_spec_files
loads files using load
with rspec-1 loaded
raises with a helpful message
#treat_symbols_as_metadata_keys_with_true_values?
defaults to false
can be set to true
#mock_framework
defaults to :rspec
#mock_framework=
uses the null adapter when set to any unknown key
with rspec
requires the adapter for :rspec
with mocha
requires the adapter for :mocha
with rr
requires the adapter for :rr
with flexmock
requires the adapter for :flexmock
with a module
sets the mock_framework_adapter to that module
#mock_with
delegates to mock_framework=
#expectation_framework
defaults to :rspec
#expectation_framework=
delegates to expect_with=
#expect_with
raises ArgumentError if framework is not supported
with rspec
requires the adapter for :rspec
with stdlib
requires the adapter for :stdlib
#expecting_with_rspec?
returns false by default
returns true when `expect_with :rspec` has been configured
returns true when `expect_with :rspec, :stdlib` has been configured
returns true when `expect_with :stdlib, :rspec` has been configured
returns false when `expect_with :stdlib` has been configured
setting the files to run
loads files not following pattern if named explicitly
with default --pattern
loads files named _spec.rb
loads files in Windows
with explicit pattern (single)
loads files following pattern
loads files in directories following pattern
does not load files in directories not following pattern
with explicit pattern (comma,separated,values)
supports comma separated values
supports comma separated values with spaces
with line number
assigns the line number as the filter
with full_description
overrides :focused
assigns the example name as the filter on description
#include
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
with no filter
includes the given module into each example group
with a filter
includes the given module into each matching example group
#extend
extends the given module into each matching example group
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
run_all_when_everything_filtered?
defaults to false
can be queried with question method
#color_enabled=
given true
with non-tty output and no autotest
does not set color_enabled
with tty output
does not set color_enabled
with tty set
does not set color_enabled
on windows
with ANSICON available
enables colors
leaves output stream intact
with ANSICON NOT available
warns to install ANSICON
sets color_enabled to false
formatter=
delegates to add_formatter (better API for user-facing configuration)
add_formatter
adds to the list of formatters
finds a formatter by name (w/ Symbol)
finds a formatter by name (w/ String)
finds a formatter by class
finds a formatter by class name
finds a formatter by class fully qualified name
requires a formatter file based on its fully qualified name
raises NameError if class is unresolvable
raises ArgumentError if formatter is unknown
with a 2nd arg defining the output
creates a file at that path and sets it as the output
#filter_run
sets the filter
merges with existing filters
warns if :line_number is already a filter
warns if :full_description is already a filter
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
#filter_run_excluding
sets the filter
merges with existing filters
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
#exclusion_filter
the default :if filter
does not exclude a spec with no :if metadata
does not exclude a spec with { :if => true } metadata
excludes a spec with { :if => false } metadata
excludes a spec with { :if => nil } metadata
the default :unless filter
excludes a spec with { :unless => true } metadata
does not exclude a spec with { :unless => false } metadata
does not exclude a spec with { :unless => nil } metadata
line_number=
sets the line number
overrides :focused
prevents :focused
#full_backtrace=
clears the backtrace clean patterns
doesn't impact other instances of config
#debug=true
requires 'ruby-debug'
starts the debugger
#debug=false
does not require 'ruby-debug'
#output=
sets the output
#libs=
adds directories to the LOAD_PATH
#requires=
requires paths
#add_setting
with no modifiers
with no additional options
defaults to nil
adds a predicate
can be overridden
with :default => 'a value'
defaults to 'a value'
returns true for the predicate
can be overridden with a truthy value
can be overridden with nil
can be overridden with false
with :alias =>
delegates the getter to the other option
delegates the setter to the other option
delegates the predicate to the other option
#configure_group
extends with 'extend'
extends with 'module'
requires only one matching filter
includes each one before deciding whether to include the next
#alias_example_to
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
deprecations
Spec
is deprecated
returns RSpec
doesn't include backward compatibility in const_missing backtrace
RSpec::Core::ExampleGroup
running_example
is deprecated
delegates to example
Spec::Runner.configure
is deprecated
Spec::Rake::SpecTask
is deprecated
doesn't include backward compatibility in const_missing backtrace
::DRbCommandLine
without server running
raises an error
--drb-port
without RSPEC_DRB environment variable set
defaults to 8989
sets the DRb port
with RSPEC_DRB environment variable set
without config variable set
uses RSPEC_DRB value
and config variable set
uses configured value
with server running
returns true
integrates via Runner.new.run
outputs green colorized text when running with --colour option (PENDING: figure out a way to properly sandbox this)
outputs red colorized text when running with -c option (PENDING: figure out a way to properly sandbox this)
RSpec::Core::ExampleGroup
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
processes string args as part of the description
processes symbol args as part of the description
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
does not treat the first argument as a metadata key even if it is a symbol
treats the first argument as part of the description when it is a symbol
top level group
runs its children
with a failure in the top level group
runs its children
descendants
returns self + all descendants
child
is known by parent
is not registered in world
filtering
includes all examples in an explicitly included group
includes explicitly included examples
excludes all examples in an excluded group
filters out excluded examples
with no filters
returns all
with no examples or groups that match filters
returns none
#describes
with a constant as the first parameter
is that constant
with a string as the first parameter
is nil
with a constant in an outer group
and a string in an inner group
is the top level constant
in a nested group
inherits the described class/module from the outer group
#described_class
is the same as describes
#description
grabs the description from the metadata
#metadata
adds the third parameter to the metadata
adds the the file_path to metadata
has a reader for file_path
adds the line_number to metadata
#focus
defines an example that can be filtered with :focused => true
defines an example that can be filtered with :focus => true
#focused
defines an example that can be filtered with :focused => true
defines an example that can be filtered with :focus => true
#before, after, and around hooks
runs the before alls in order
runs the before eachs in order
runs the after eachs in reverse order
runs the after alls in reverse order
only runs before/after(:all) hooks from example groups that have specs that run
runs before_all_defined_in_config, before all, before each, example, after each, after all, after_all_defined_in_config in that order
treats an error in before(:each) as a failure
treats an error in before(:all) as a failure
treats an error in before(:all) as a failure for a spec in a nested group
has no 'running example' within before(:all)
has access to example options within before(:each)
has access to example options within after(:each)
has no 'running example' within after(:all)
after(:all)
has access to state defined before(:all)
cleans up ivars in after(:all)
when an error occurs in an after(:all) hook
allows the example to pass
rescues the error and prints it out
adding examples
allows adding an example using 'it'
allows adding a pending example using 'xit'
exposes all examples at examples
maintains the example order
Object describing nested example_groups
A sample nested group
sets the described class to the described class of the outer most group
sets the description to 'A sample nested describe'
has top level metadata from the example_group and its ancestors
exposes the parent metadata to the contained examples
#run_examples
returns true if all examples pass
returns false if any of the examples fail
runs all examples, regardless of any of them failing
how instance variables are inherited
can access a before each ivar at the same level
can access a before all ivar at the same level
can access the before all ivars in the before_all_ivars hash
but now I am nested
can access a parent example groups before each ivar at a nested level
can access a parent example groups before all ivar at a nested level
changes to before all ivars from within an example do not persist outside the current describe
accessing a before_all ivar that was changed in a parent example_group
does not have access to the modified version
ivars are not shared across examples
(first example)
(second example)
#top_level_description
returns the description from the outermost example group
#run
with fail_fast? => true
does not run examples after the failed example
with RSpec.wants_to_quit=true
returns without starting the group
at top level
purges remaining groups
in a nested group
does not purge remaining groups
with all examples passing
returns true
with top level example failing
returns false
with nested example failing
returns true
#include_context
includes the named context
RSpec::Core::Example
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
auto-generated example descriptions
when `expect_with :rspec` is configured
generates a description for an example with no description
when `expect_with :rspec, :stdlib` is configured
generates a description for an example with no description
when `expect_with :stdlib` is configured
does not attempt to get the generated description from RSpec::Matchers
fails an example with no description
#described_class
returns the class (if any) of the outermost example group
accessing metadata within a running example
has a reference to itself when running
can access the example group's top level metadata as if it were its own
accessing options within a running example
can look up option values by key
#run
sets its reference to the example group instance to nil
runs after(:each) when the example passes
runs after(:each) when the example fails
runs after(:each) when the example raises an Exception
wraps before/after(:each) inside around
with an after(:each) that raises
runs subsequent after(:each)'s
stores the exception
clearing ivars
sets ivars to nil to prep them for GC
does not impact the before_all_ivars which are copied to each example
#pending
in the example
sets the example to pending
allows post-example processing in around hooks (see https://github.com/rspec/rspec-core/issues/322)
in before(:each)
sets each example to pending
in before(:all)
sets each example to pending
in around(:each)
sets the example to pending
RSpec::Core::Formatters::BaseFormatter
backtrace_line
trims current working directory
leaves the original line intact
read_failed_line
deals gracefully with a heterogeneous language stack trace
when String alias to_int to_i
doesn't hang when file exists
#format_backtrace
removes lines from rspec and lines that come before the invocation of the at_exit autorun hook
RSpec::Core::Formatters::BaseTextFormatter
#summary_line
with 0s
outputs pluralized (excluding pending)
with 1s
outputs singular (including pending)
with 2s
outputs pluralized (including pending)
#dump_failures
preserves formatting
with an exception without a message
does not throw NoMethodError
with an exception class other than RSpec
does not show the error class
with a failed expectation (rspec-expectations)
does not show the error class
with a failed message expectation (rspec-mocks)
does not show the error class
for #share_examples_for
outputs the name and location
that contains nested example groups
outputs the name and location
for #share_as
outputs the name and location
that contains nested example groups
outputs the name and location
#dump_profile
names the example
prints the time
prints the path
RSpec::Core::Formatters::DocumentationFormatter
numbers the failures
represents nested group using hierarchy tree
RSpec::Core::Formatters::Helpers
format seconds
sub second times
returns 5 digits of precision
strips off trailing zeroes beyond sub-second precision
0
strips off trailing zeroes
> 1
strips off trailing zeroes
second and greater times
returns 2 digits of precision
returns human friendly elasped time
RSpec::Core::Formatters::HtmlFormatter
produces HTML identical to the one we designed manually
RSpec::Core::Formatters::ProgressFormatter
produces line break on start dump
produces standard summary without pending when pending has a 0 count
pushes nothing on start
RSpec::Core::Formatters::SnippetExtractor
falls back on a default message when it doesn't understand a line
falls back on a default message when it doesn't find the file
RSpec::Core::Formatters::TextMateFormatter
produces HTML identical to the one we designed manually
has a backtrace line from the raw erb evaluation
has a backtrace line from a erb source file we forced to appear
config block hook filtering
unfiltered hooks
should be ran
hooks with single filters
should be ran if the filter matches the example group's filter
runs before|after :all hooks on matching nested example groups
runs before|after :all hooks only on the highest level group that matches the filter
should not be ran if the filter doesn't match the example group's filter
with no scope specified
should be ran around|before|after :each if the filter matches the example group's filter
when the hook filters apply to individual examples instead of example groups
an example with matching metadata
runs the `:each` hooks
does not run the `:all` hooks
an example without matching metadata
does not run any of the hooks
hooks with multiple filters
should be ran if all hook filters match the group's filters
should not be ran if some hook filters don't match the group's filters
RSpec::Core::Hooks
#before(each)
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
#before(all)
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#before(no scope)
defaults to :each scope if no arguments are given
defaults to :each scope if the only argument is a metadata hash
raises an error if only metadata symbols are given as arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#before(no scope)
defaults to :each scope if no arguments are given
defaults to :each scope if the only argument is a metadata hash
raises an error if only metadata symbols are given as arguments
#after(each)
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
#after(all)
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#after(no scope)
defaults to :each scope if no arguments are given
defaults to :each scope if the only argument is a metadata hash
raises an error if only metadata symbols are given as arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#after(no scope)
defaults to :each scope if no arguments are given
defaults to :each scope if the only argument is a metadata hash
raises an error if only metadata symbols are given as arguments
#around(each)
behaves like metadata hash builder
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
treats symbols as metadata keys with a true value
still processes hash values normally
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
prints a deprecation warning about any symbols given as arguments
does not treat symbols as metadata keys
does not print a warning if there are no symbol arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#around(no scope)
defaults to :each scope if no arguments are given
defaults to :each scope if the only argument is a metadata hash
raises an error if only metadata symbols are given as arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#around(no scope)
defaults to :each scope if no arguments are given
defaults to :each scope if the only argument is a metadata hash
raises an error if only metadata symbols are given as arguments
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#before(:each)
does not make :each a metadata key
is scoped to :each
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#before(:each)
does not make :each a metadata key
is scoped to :each
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#before(:all)
does not make :all a metadata key
is scoped to :all
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#before(:all)
does not make :all a metadata key
is scoped to :all
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#before(:suite)
does not make :suite a metadata key
is scoped to :suite
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#before(:suite)
does not make :suite a metadata key
is scoped to :suite
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#after(:each)
does not make :each a metadata key
is scoped to :each
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#after(:each)
does not make :each a metadata key
is scoped to :each
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#after(:all)
does not make :all a metadata key
is scoped to :all
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#after(:all)
does not make :all a metadata key
is scoped to :all
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to true
#after(:suite)
does not make :suite a metadata key
is scoped to :suite
when RSpec.configuration.treat_symbols_as_metadata_keys_with_true_values is set to false
#after(:suite)
does not make :suite a metadata key
is scoped to :suite
#around
when not running the example within the around block
does not run the example
when running the example within the around block
runs the example
when running the example within a block passed to a method
runs the example
RSpec::Core::Hooks::Hook
requires a block
extensions
debugger
is defined on Kernel
#let
generates an instance method
caches the value
#let!
evaluates the value non-lazily
does not interfere between tests
RSpec::Core::Metadata
#process
prohibits :description as a hash key
prohibits :example_group as a hash key
prohibits :execution_result as a hash key
prohibits :file_path as a hash key
prohibits :full_description as a hash key
prohibits :line_number as a hash key
prohibits :location as a hash key
uses :caller if passed as part of the user metadata
#apply_condition
matches the group when the line_number is the example group line number
matches the example when the line_number is the grandparent example group line number
matches the example when the line_number is the parent example group line number
matches the example when the line_number is the example line number
matches when the line number is between this example and the next
does not match when the line number matches the next example
matches a proc that evaluates to true
does not match a proc that evaluates to false
passes the metadata hash as the second argument if a given proc expects 2 args
#for_example
stores the description
stores the full_description (group description + example description)
creates an empty execution result
extracts file path from caller
extracts line number from caller
extracts location from caller
uses :caller if passed as an option
merges arbitrary options
points :example_group to the same hash object
:describes
with a String
returns nil
with a Symbol
returns nil
with a class
returns the class
with describes from a superclass metadata
returns the superclass' described class
:description
just has the example description
with a string
provides the submitted description
with a non-string
provides the submitted description
with a non-string and a string
concats the args
:full_description
concats example group name and description
concats nested example group descriptions
with a 2nd arg starting with #
removes the space
with a 2nd arg starting with .
removes the space
with a 2nd arg starting with ::
removes the space
with a nested description starting with #
removes the space
with a nested description starting with .
removes the space
with a nested description starting with ::
removes the space
:file_path
finds the first non-rspec lib file in the caller array
:line_number
finds the line number with the first non-rspec lib file in the backtrace
finds the line number with the first spec file with drive letter
uses the number after the first : for ruby 1.9
child example group
nests the parent's example group metadata
OptionParser
does not parse empty args
--formatter
is deprecated
gets converted to --format
--format
defines the formatter
-f
defines the formatter
--out
sets the output stream for the formatter
with multiple formatters
after last formatter
sets the output stream for the last formatter
after first formatter
sets the output stream for the first formatter
-o
sets the output stream for the formatter
with multiple formatters
after last formatter
sets the output stream for the last formatter
after first formatter
sets the output stream for the first formatter
--example
escapes the arg
an example
with no block
is listed as pending with 'Not Yet Implemented'
with no args
is listed as pending with the default message
with no docstring
declared with the pending method
does not have an auto-generated description
after another example with some assertion
does not show any message
with a message
is listed as pending with the supplied message
with a block
that fails
when given no options
is listed as pending with the supplied message
is listed as pending with the default message when no message is given
when given a truthy :if option
is listed as pending with the supplied message
is listed as pending with the default message when no message is given
when given a falsey :if option
runs the example and fails
when given a truthy :unless option
runs the example and fails
when given a falsey :unless option
is listed as pending with the supplied message
is listed as pending with the default message when no message is given
that passes
when given no options
fails with a PendingExampleFixedError
when given a truthy :if option
fails with a PendingExampleFixedError
when given a falsey :if option
runs the example and it passes
when given a truthy :unless option
runs the example and it passes
when given a falsey :unless option
fails with a PendingExampleFixedError
RSpec::Core::RakeTask
default
renders rspec
with bundler
with Gemfile
renders bundle exec rspec
with non-standard Gemfile
renders bundle exec rspec
without Gemfile
renders bundle exec rspec
with rcov
renders rcov
with bundler and rcov
renders bundle exec rcov
with ruby options
renders them before -S
with rcov_opts
with rcov=false (default)
does not add the rcov options to the command
with rcov=true
renders them after rcov
ensures that -Ispec:lib is in the resulting command
with rspec_opts
with rcov=true
adds the rspec_opts after the rcov_opts and files
with rcov=false (default)
adds the rspec_opts
with SPEC=path/to/file
sets files to run
with paths with quotes
escapes the quotes
RSpec::Core::Reporter
abort
sends start_dump to the formatter(s)
sends dump_pending to the formatter(s)
sends dump_failures to the formatter(s)
sends dump_summary to the formatter(s)
sends close to the formatter(s)
given one formatter
passes messages to that formatter
passes example_group_started and example_group_finished messages to that formatter in that order
given an example group with no examples
does not pass example_group_started or example_group_finished to formatter
given multiple formatters
passes messages to all formatters
RSpec::Matchers
behaves like a normal module with a method that supers
raises the expected error (and not SystemStackError)
when RSpec::Matchers has been included in an example group
behaves like a normal module with a method that supers
raises the expected error (and not SystemStackError)
when a module that includes RSpec::Matchers has been included in an example group
behaves like a normal module with a method that supers
raises the expected error (and not SystemStackError)
when RSpec::Matchers is included via configuration
behaves like a normal module with a method that supers
raises the expected error (and not SystemStackError)
when RSpec::Matchers is included in a module that is included via configuration
behaves like a normal module with a method that supers
raises the expected error (and not SystemStackError)
RSpec::Core::RubyProject
#determine_root
with ancestor containing spec directory
returns ancestor containing the spec directory
without ancestor containing spec directory
returns current working directory
RSpec::Core::Runner
at_exit
sets an at_exit hook if none is already set
does not set the at_exit hook if it is already set
#run
with --drb or -X
and a DRb server is running
builds a DRbCommandLine and runs the specs
and a DRb server is not running
outputs a message
builds a CommandLine and runs the specs
RSpec::Core::SharedContext
hooks
creates a before hook
RSpec::Core::SharedExampleGroup
share_examples_for
is exposed to the global namespace
raises an ArgumentError when adding a second shared example group with the same name
given a string
captures the given string and block in the World's collection of shared example groups
given a symbol
captures the given symbol and block in the World's collection of shared example groups
given a hash
delegates extend on configuration