Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rspec for Beginners - Jason Arhart

4.1k

Rspec for Beginners - Jason Arhart

Las Vegas Ruby Group

July 31, 2013
Tweet

Transcript

  1. What is TDD? • Test-Driven Development • TDD is a

    development technique Thursday, August 1, 13
  2. What is TDD? • Test-Driven Development • TDD is a

    development technique • The tests are written first Thursday, August 1, 13
  3. Why do TDD? • Code is testable from the start

    • Ensures that your tests actually work Thursday, August 1, 13
  4. Why do TDD? • Code is testable from the start

    • Ensures that your tests actually work • Focus on what before how Thursday, August 1, 13
  5. Why do TDD? • Code is testable from the start

    • Ensures that your tests actually work • Focus on what before how • Consistent test coverage Thursday, August 1, 13
  6. Why do TDD? • Code is testable from the start

    • Ensures that your tests actually work • Focus on what before how • Consistent test coverage • Enables refactoring Thursday, August 1, 13
  7. Why do TDD? • Code is testable from the start

    • Ensures that your tests actually work • Focus on what before how • Consistent test coverage • Enables refactoring • Less time spent debugging Thursday, August 1, 13
  8. Anatomy of a TDD Tool • A library for writing

    automated tests Thursday, August 1, 13
  9. Anatomy of a TDD Tool • A library for writing

    automated tests • A framework for organizing tests into a test suite Thursday, August 1, 13
  10. Anatomy of a TDD Tool • A library for writing

    automated tests • A framework for organizing tests into a test suite • A way to run the tests Thursday, August 1, 13
  11. Why RSpec? • RSpec focuses on expected behavior • RSpec

    specifications are executable documentation Thursday, August 1, 13
  12. Why RSpec? • RSpec focuses on expected behavior • RSpec

    specifications are executable documentation • RSpec provides a rich set of tools for organizing test cases Thursday, August 1, 13
  13. Why RSpec? • RSpec focuses on expected behavior • RSpec

    specifications are executable documentation • RSpec provides a rich set of tools for organizing test cases • RSpec is currently very popular Thursday, August 1, 13
  14. Specifications • RSpec focuses on tests as executable specifications •

    Specifications describe expected behavior Thursday, August 1, 13
  15. Specifications • RSpec focuses on tests as executable specifications •

    Specifications describe expected behavior • Executable examples of expected behavior Thursday, August 1, 13
  16. Specifications • RSpec focuses on tests as executable specifications •

    Specifications describe expected behavior • Executable examples of expected behavior • Examples are executed in a controlled context Thursday, August 1, 13
  17. Other Features • More hooks • Built-in matchers for almost

    any occasion • Custom matchers for special occasions Thursday, August 1, 13
  18. Other Features • More hooks • Built-in matchers for almost

    any occasion • Custom matchers for special occasions • Shared examples Thursday, August 1, 13
  19. Other Features • More hooks • Built-in matchers for almost

    any occasion • Custom matchers for special occasions • Shared examples • Shared context Thursday, August 1, 13
  20. Other Features • More hooks • Built-in matchers for almost

    any occasion • Custom matchers for special occasions • Shared examples • Shared context • Filtering Thursday, August 1, 13
  21. Other Features • More hooks • Built-in matchers for almost

    any occasion • Custom matchers for special occasions • Shared examples • Shared context • Filtering • Metadata Thursday, August 1, 13