Complete the code to check if the variable result equals 10 using RSpec.
expect(result).to [1] 10
be which checks object identity, not value equality.have or include which are for collections.The eq matcher checks if the value is equal to the expected value.
Complete the code to check if the array numbers includes the number 5.
expect(numbers).to [1] 5
eq which checks for exact equality, not inclusion.contain which is not a valid RSpec matcher.The include matcher checks if a collection contains a specific element.
Fix the error in the code to check if the string message starts with 'Hello'.
expect(message).to [1]('Hello')
eq which checks full equality.include which checks for substring anywhere.match which expects a regex.The start_with matcher checks if a string begins with the given substring.
Fill both blanks to check if the variable value is greater than 5 and less than 10.
expect(value).to be [1] 5.and be [2] 10
The be > matcher checks if the value is greater than 5, and be < checks if it is less than 10.
Fill all three blanks to check if the hash user has a key :name with value 'Alice' and the key :age is greater than 20.
expect(user). [1] include([2] => 'Alice'}) and expect(user[:age]).to be [3] 20
have_key instead of include for key-value pairs.Use to with include to check the key-value pair, and be > to check the age.