RSpec Metadata is defined as “data about data”, which means data about the describe, context and it blocks.
When the above code is run, the output appears as −
Within the RSpec files, variables can be assigned, using Metadata. The example.metadata variable is a Ruby hash which contains other information about the Examples and Example groups.
For instance, the above code is rewritten as −
When the code is run, all of the values in the example.metadata hash are visible −
An Example Group with a metadata variable and a context with another variable can access the metadata variable in the context block.
This is a sentence created from the describe block “description + its contained context block description + the description for the it block.”
The three strings appear to be like normal English sentences, which is the idea behind RSpec, making tests sound like normal English language.
RSpec Related Tutorials
|Testing Tools Tutorial||Ruby on Rails Tutorial|
|MVC Framework Tutorial||Framework7 Tutorial|
|ReactJS Tutorial||Ruby on Rails 2.1 Tutorial|
|Cucumber Tutorial||Unittest Framework Tutorial|
|Behavior Driven Development Tutorial|
RSpec Related Interview Questions
|Testing Tools Interview Questions||PostgreSQL Interview Questions|
|Ruby on Rails Interview Questions||Ruby Interview Questions|
|MVC Framework Interview Questions||Framework7 Interview Questions|
|ReactJS Interview Questions||Redis Interview Questions|
|Cucumber Interview Questions||Unittest Framework Interview Questions|
|Ruby Sinatra Interview Questions||RabbitMQ Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.