Library providing tools for writing and running RSpec tests.
Methods for creating reusable shared example groups and shared contexts in a module that can be mixed into multiple RSpec example groups.
module MySharedExamples
extend RSpec::SleepingKingStudios::Concerns::SharedExampleGroup
shared_examples 'my examples' do
# Define shared examples here.
end # shared_examples
end # module
RSpec.describe MyObject do
include MySharedExamples
include_examples 'my examples'
end # describe
#alias_shared_examples new_name, old_name => Object
Also known as:
alias_shared_context
Aliases a defined shared example group, allowing it to be accessed using
a new name. The example group must be defined in the current context
using shared_examples
. The aliases must be defined before including the
module into an example group, or they will not be available in the
example group.
#included other => Object
Hook to merge defined example groups when included in another module.
#shared_examples(name, &block) => Object
#shared_examples(name, metadata, &block) => Object
Also known as:
shared_context
Defines a shared example group within the context of the current module. Unlike a top-level example group defined using RSpec#shared_examples, these examples are not globally available, and must be mixed into an example group by including the module. The shared examples must be defined before including the module, or they will not be available in the example group.
#shared_examples(name, &block) => Object
#shared_examples(name, metadata, &block) => Object
Back to Documentation | Reference | RSpec | RSpec::SleepingKingStudios | RSpec::SleepingKingStudios::Concerns