Rails testing environment, 2009 fall

2,245 views

Published on

introduce rails and its testing frameworks in pen source conference 2009 Tokyo/Fall at 2009-10-31

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,245
On SlideShare
0
From Embeds
0
Number of Embeds
563
Actions
Shares
0
Downloads
24
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Rails testing environment, 2009 fall

  1. 1. 2009 2009-10-31 OSC 2009 Tokyo/Fall Rails 2009 11 2
  2. 2. (::) 2009 11 2
  3. 3. 2009 - Model by AR or Ruby RSpec on Rails Controller by AC RSpec on Rails View by Haml or .. RSpec on Rails (many) Helper by AV or .. RSpec on Rails 2009-01-24 Ruby 01 2009 11 2
  4. 4. 2009 Rails ✓ ✓ ✓ 2009 11 2
  5. 5. (::) 2009 11 2
  6. 6. http://d.hatena.ne.jp/moro/ ✓ ✓ ✓http://ruby.agile.esm.co.jp/ 2009 11 2
  7. 7. http://amazon.jp/gp/product/4797336625 2009 11 2
  8. 8. 2009 11 2
  9. 9. (::) 2009 11 2
  10. 10. 2008-10 Ruby 01 2009 11 2
  11. 11. Cucumber&RSpec ✓ ✓ 2009 11 2
  12. 12. (::) 2009 11 2
  13. 13. http://cukes.info 2009 11 2
  14. 14. Cucumber ✓ ✓ 2009 11 2
  15. 15. 2009 11 2
  16. 16. Execute Plain Text ✓ “features” ✓ ✓ “step_definitions” ✓ features Ruby 2009 11 2
  17. 17. 2009 11 2
  18. 18. Given( /^Wiki"(.*)" "(.*)" $/) do |nname, pname|   note = Note.find_by_name(nname)   attrs = valid_attributes[:page].merge({ :display_name => pname })   page = note.build_front_page   page.attributes = attrs   content = "#{nname} !"   page.edit(content, @user)   page.save end   http://github.com/openskip/skip-wiki/blob/master/features/step_definitions/skip_note_steps.rb 2009 11 2
  19. 19. # Order is opposite from original (English) version When /^"([^"]*)" "([^"]*)" $/ do |parent, link|   When %Q(I follow "#{link}" within "#{parent}") end   When /^"([^"]*)" "([^"]*)" $/ do |field, value|   When %Q(I fill in "#{field}" with "#{value}") end http://github.com/moro/miso/blob/master/rails_generators/miso/templates/webrat_ja_steps.rb 2009 11 2
  20. 20. Black box 2009 11 2
  21. 21. Rails ✓ ✓ ✓ 2009 11 2
  22. 22. (::) 2009 11 2
  23. 23. http://rspec.info 2009 11 2
  24. 24. describe DeltaAttack::FiletypeAssumption do   include SpecHelper   it "should not support_magic" do     DeltaAttack::FiletypeAssumption.should_not be_support_magic   end     describe "new('hoge.xls')" do     before do       @asm = DeltaAttack::FiletypeAssumption.new('hoge.xls')     end       it "filetype.should == :excel" do       @asm.filetype.should == :excel     end   end end http://github.com/moro/delta_attack/blob/master/spec/filetype_assumption_spec.rb 2009 11 2
  25. 25. RSpec ✓ ✓ ✓ 2009 11 2
  26. 26. ✓ subject { } ✓ its(:attr){ } 2009 11 2
  27. 27. subject { } ✓ Example(it) (=subject) ✓it{ } should ✓subject{ } should 2009 11 2
  28. 28. describe Array do before do @arr = [1,2,3] end it{ @arr.should have(3).items } end 2009 11 2
  29. 29. describe Array do before do @arr = [1,2,3] end subject{ @arr } it{ should have(3).items } end 2009 11 2
  30. 30. before ✓ before {} ✓ subject{} 2009 11 2
  31. 31. its() ✓ 1.2.9 ✓ subject{} its() send 2009 11 2
  32. 32. describe Array do before do @arr = [1,2,3] end subject{ @arr.size } it{ should == 3 } end 2009 11 2
  33. 33. describe Array do before do @arr = [1,2,3] end subject{ @arr } its(:size){ should == 3 } end 2009 11 2
  34. 34. ✓ subject ✓ ✓ CustomMatcher 2009 11 2
  35. 35. RSpec ✓ ✓ ✓ 2009 11 2
  36. 36. Rails ✓ ✓ ✓ ✓ 2009 11 2
  37. 37. (::) 2009 11 2
  38. 38. 2009 Rails ✓ ✓ ✓ 2009 11 2
  39. 39. 2009 - Model by AR or Ruby RSpec on Rails Controller by AC RSpec on Rails View by Haml or .. RSpec on Rails (many) Helper by AV or .. RSpec on Rails 2009-01-24 Ruby 01 2009 11 2
  40. 40. http://wiki.fdiary.net/rails/?RailsMeetingTokyo-0045 2009 11 2
  41. 41. 2009 11 2

×