What is the name for the 'describe it' format in testing?



  • This is with ruby-rspec but I have seen it for other languages too.
    BDD is one term but maybe that is to too general as it covers Cucumber which doesn't use this format.

    Example:

    describe "Stuff" do
      it "does stuff" do
         a=1
         expect(a).to eq 1
      end
    end
    


  • I've generally seen it referred to as "xSpec"; that style was popularised, if not invented, by RSpec and there are others like JSpec (for Java, which uses it but not describe).

    The JavaScript framework Mocha (and other tools that have adopted it, like Cypress) refers to this API as "the BDD interface". Jasmine, which also uses that style but doesn't explicitly name it, describes itself as a "behavior-driven development framework", and was explicitly influenced by RSpec and JSpec.

    (It's certainly not xUnit; xUnit test frameworks are those that represent suites as classes implementing TestCase and tests as methods on those classes.)


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2