Top Level Namespace
- Includes:
- NRSER::RSpex::ExampleGroup
Defined Under Namespace
Modules: Enumerable, Hamster, I8, NRSER Classes: Array, Binding, Exception, Hash, Method, Module, Object, OpenStruct, Pathname, String, Symbol, Time, UnboundMethod, Wrapper
Instance Method Summary collapse
- #Args(*args) ⇒ Object
-
#I8(value = nil) ⇒ Object
Method proxy to I8.[] allowing for different syntaxes.
- #List(*args) ⇒ Object
-
#merge_expectations(*expectations) ⇒ Object
Merge “expectation” hashes by appending all clauses for each state.
- #msg(*args, &block) ⇒ Object
- #unwrap(obj, context: nil) ⇒ Object
- #wrap(description = nil, &block) ⇒ Object
Methods included from NRSER::RSpex::ExampleGroup
#describe_attribute, #describe_called, #describe_called_with, #describe_case, #describe_class, #describe_group, #describe_instance, #describe_instance_method, #describe_message, #describe_method, #describe_module, #describe_response_to, #describe_section, #describe_sent_to, #describe_setup, #describe_source_file, #describe_spec_file, #describe_subject, #describe_when, #describe_x, #dive_x
Instance Method Details
#Args(*args) ⇒ Object
132 133 134 |
# File 'lib/nrser/rspex.rb', line 132 def Args *args NRSER::RSpex::Args.new args end |
#I8(value = nil) ⇒ Object
Method proxy to I8.[] allowing for different syntaxes.
121 122 123 |
# File 'lib/nrser/labs/i8.rb', line 121 def I8 value = nil I8[ value || yield ] end |
#List(*args) ⇒ Object
128 129 130 |
# File 'lib/nrser/rspex.rb', line 128 def List *args NRSER::RSpex::List.new args end |
#merge_expectations(*expectations) ⇒ Object
Merge “expectation” hashes by appending all clauses for each state.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/nrser/rspex.rb', line 50 def merge_expectations *expectations Hash.new { |result, state| result[state] = [] }.tap { |result| expectations.each { |ex| ex.each { |state, clauses| result[state] += clauses.to_a } } } end |
#msg(*args, &block) ⇒ Object
123 124 125 |
# File 'lib/nrser/rspex.rb', line 123 def msg *args, &block NRSER::Message.from *args, &block end |