Week7

378 views
333 views

Published on

UWE-Ruby Week 7

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
378
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Week7

    1. 1. RubyWeek 7
    2. 2. Mid-Term Review• Not Done Grading• Overall looks pretty good• Questions??
    3. 3. TESTING Agenda• Behavior Driven Development with Cucumber• Fun with MiniTest• TestUnit and Cucumber with Jeweler and Travis• Why Testing? With Nell!
    4. 4. Behavior Driven Development• User Stories• Business Value• Communication• Shared Tools
    5. 5. Behavior Specs• Title• Narrative• Acceptance Criteria / Scenarios / Outcomes
    6. 6. • gem install cucumber• cucumber --help
    7. 7. Features• Human Read/Writable description of behavior• Business Users write the features, Programmers develop the features to spec• https://github.com/cucumber/cucumber/wiki/ Feature-Introduction
    8. 8. Given-When-Then• Describing your feature• Preconditions• Something happens• Expected outcome
    9. 9. Step Definitions• REGEXP!!• Translation between the human narrative and the code• This type of sentence, matches to this type of code
    10. 10. Demo!• I want a Celsius to Fahrenheit converter• I tell my story• I copy the generated regex• I write my tests• TDD!
    11. 11. Example!• New Feature!• I’m in London and I can’t share bar stories without being able to convert Fahrenheit to Celsius• Write the Steps• Make Them Pass!
    12. 12. MiniTest• Built into Ruby 1.9!• SeattleRB! (meets Tuesday nights )• Light, Fast, FUN!
    13. 13. Example• Make a ruby file• Add some tests• Make them pass• All Ruby!
    14. 14. Test Unit• Jeweler!• Simple testing framework• Used lots of places!
    15. 15. Cucumber with Jeweler and Travis• EXAMPLE!• Add cucumber to Gemfile• Run bundler• Add feature, steps, and support (env.rb)• Add to travis.yml file
    16. 16. Homework• Read Chapter 23 and 24 DuckTyping and MetaProgramming• Make the cucumber features pass

    ×