RSpec – Tags
RSpec Tags provide an easy way to run specific tests in your spec files. By default, RSpec will run all tests in the spec files that it runs, but you…
RSpec Tags provide an easy way to run specific tests in your spec files. By default, RSpec will run all tests in the spec files that it runs, but you…
When you are writing unit tests, it is often convenient to run setup and teardown code before and after your tests. Setup code is the code that configures or âsets…
If youâve already read the section on RSpec Doubles (aka Mocks), then you have already seen RSpec Stubs. In RSpec, a stub is often called a Method Stub, itâs a…
In this chapter, we will discuss RSpec Doubles, also known as RSpec Mocks. A Double is an object which can âstand inâ for another object. Youâre probably wondering what that…
If you recall our original Hello World example, it contained a line that looked like this â expect(message).to eq "Hello World!" The keyword eql is an RSpec âmatcherâ. Here, we will introduce…
In this chapter, we will create a new Ruby class, save it in its own file and create a separate spec file to test this class. First, in our new…
Letâs take a closer look at the code of our HelloWorld example. First of all, in case it isnât clear, we are testing the functionality of the HelloWorld class. This of course, is a…
RSpec is a unit test framework for the Ruby programming language. RSpec is different than traditional xUnit frameworks like JUnit because RSpec is a Behavior driven development tool. What this…
The following table lists all the Ruby's Predefined Constants â NOTE â TRUE, FALSE, and NIL are backward-compatible. It's preferable to use true, false, and nil. Sr.No.Constant Name & Description1TRUESynonym for…
Traditional programs have a single thread of execution the statements or instructions that comprise the program are executed sequentially until the program terminates. A multithreaded program has more than one thread of…