• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
BDD for Rails Legacy Code
 

BDD for Rails Legacy Code

on

  • 2,275 views

 

Statistics

Views

Total Views
2,275
Views on SlideShare
2,269
Embed Views
6

Actions

Likes
1
Downloads
72
Comments
0

1 Embed 6

http://www.slideshare.net 6

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

BDD for Rails Legacy Code BDD for Rails Legacy Code Presentation Transcript

  • BDD for Rails Legacy Code
  • About Me  Lu Wei Jen  Rails Developer  http://blog.weijen.net  http://www.facebook.com/ weijenlu  Twitter: weijenlu 
  • 10
  • 10
  • Legacy Code
  • Agenda • • BDD • BDD • Legacy Code • Legacy Code
  • • • • •
  • Changes Changes Changes Changes Changes Changes
  • BDD • Behavior Driven Development • •
  • BDD Tools for Rails • Cucumber • Webrat • RSpec
  • Cucumber • • •
  • Cucumber
  • Cucumber
  • Cucumber Mock Object
  • Webrat • • • • form •
  • Webrat: • visit "http://rubyconf.tw" • click_link " "
  • Webrat: Form • file_in " ", :with => "weijen" • check " " • select " ", :from => " " • click_button
  • Webrat: • response.should contain(" ") • response.should have_selector("img.photo")
  • RSpec
  • • • • • •
  • • • •
  • • Waybill model #set_customer • Waybills_controller #create
  • Model
  • Model
  • Mock Object • • • •
  • Mock Object • my_mock = mock(name) • my_mock = mock(name, stubs) • my_mock = mock_model(name, stubs)
  • • my_mock.stub!(:msg).with(args).and_return(value)
  • Message Expectation • my_mock.should_receive(:msg).with(args).and_r eturn(value)
  • Mock
  • Controller
  • Controller
  • Cucumber
  • • +
  • • No Silver Bullet • •
  • Q &A