Your SlideShare is downloading. ×
  • Like
BDD for Rails Legacy Code
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

BDD for Rails Legacy Code

  • 1,541 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,541
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
73
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide























































Transcript

  • 1. BDD for Rails Legacy Code
  • 2. About Me  Lu Wei Jen  Rails Developer  http://blog.weijen.net  http://www.facebook.com/ weijenlu  Twitter: weijenlu 
  • 3. 10
  • 4. 10
  • 5. Legacy Code
  • 6. Agenda • • BDD • BDD • Legacy Code • Legacy Code
  • 7. • • • •
  • 8. Changes Changes Changes Changes Changes Changes
  • 9. BDD • Behavior Driven Development • •
  • 10. BDD Tools for Rails • Cucumber • Webrat • RSpec
  • 11. Cucumber • • •
  • 12. Cucumber
  • 13. Cucumber
  • 14. Cucumber Mock Object
  • 15. Webrat • • • • form •
  • 16. Webrat: • visit "http://rubyconf.tw" • click_link " "
  • 17. Webrat: Form • file_in " ", :with => "weijen" • check " " • select " ", :from => " " • click_button
  • 18. Webrat: • response.should contain(" ") • response.should have_selector("img.photo")
  • 19. RSpec
  • 20. • • • • •
  • 21. • • •
  • 22. • Waybill model #set_customer • Waybills_controller #create
  • 23. Model
  • 24. Model
  • 25. Mock Object • • • •
  • 26. Mock Object • my_mock = mock(name) • my_mock = mock(name, stubs) • my_mock = mock_model(name, stubs)
  • 27. • my_mock.stub!(:msg).with(args).and_return(value)
  • 28. Message Expectation • my_mock.should_receive(:msg).with(args).and_r eturn(value)
  • 29. Mock
  • 30. Controller
  • 31. Controller
  • 32. Cucumber
  • 33.
  • 34. • +
  • 35. • No Silver Bullet • •
  • 36. Q &A