I’m new to rspec. The following syntax is confusing:
describe MyClass::Something do
What does Something refer to? The rspec tests I’m looking over contain the above line. However MyClass doesn’t contain anything related to Something.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are confused by Ruby syntax, not RSpec syntax.
MyClassis a module, andSomethingis a class or module inside theMyClassmodule. The::is the scope resolution operator to tell Ruby whichSomethingyou are looking for.See http://ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html for more on modules.