SlideShare a Scribd company logo
1 of 41
Download to read offline
2009
                2009-10-31 OSC 2009 Tokyo/Fall
                                          Rails




2009   11   2
(::)
2009   11   2
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
2009   Rails

                ✓
                ✓

                ✓


2009   11   2
(::)
2009   11   2
http://d.hatena.ne.jp/moro/

                ✓

                ✓

                ✓http://ruby.agile.esm.co.jp/
2009   11   2
http://amazon.jp/gp/product/4797336625
2009   11   2
2009   11   2
(::)
2009   11   2
2008-10   Ruby   01


2009   11   2
Cucumber&RSpec

                ✓
                ✓



2009   11   2
(::)
2009   11   2
http://cukes.info
2009   11   2
Cucumber
                ✓


                ✓




2009   11   2
2009   11   2
Execute Plain Text
                ✓ “features”
                 ✓

                ✓ “step_definitions”
                 ✓             features   Ruby




2009   11   2
2009   11   2
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
# 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
Black box




2009   11   2
Rails

                ✓

                ✓
                ✓


2009   11   2
(::)
2009   11   2
http://rspec.info
2009   11   2
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
RSpec
                ✓

                ✓

                ✓

2009   11   2
✓   subject { }
                ✓   its(:attr){ }


2009   11   2
subject { }
                ✓    Example(it)   (=subject)



                ✓it{ }                 should



                ✓subject{ }
                    should



2009   11   2
describe Array do
         before do
           @arr = [1,2,3]
         end
         it{ @arr.should have(3).items }
       end




2009   11   2
describe Array do
         before do
           @arr = [1,2,3]
         end

         subject{ @arr }
         it{ should have(3).items }
       end




2009   11   2
before
                ✓
                    before {}

                ✓ subject{}




2009   11   2
its()

                ✓       1.2.9

                ✓ subject{}             its()
                      send




2009   11   2
describe Array do
         before do
           @arr = [1,2,3]
         end

         subject{ @arr.size }
         it{ should == 3 }
       end




2009   11   2
describe Array do
         before do
           @arr = [1,2,3]
         end

         subject{ @arr }
         its(:size){ should == 3 }
       end




2009   11   2
✓ subject


                 ✓
                ✓ CustomMatcher



2009   11   2
RSpec

                ✓
                ✓
                ✓



2009   11   2
Rails
                ✓
                ✓

                ✓
                ✓

2009   11   2
(::)
2009   11   2
2009   Rails

                ✓
                ✓

                ✓


2009   11   2
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
http://wiki.fdiary.net/rails/?RailsMeetingTokyo-0045
2009   11   2
2009   11   2

More Related Content

Similar to Rails testing environment, 2009 fall

Railswaycon 2009 - Summary
Railswaycon 2009 - SummaryRailswaycon 2009 - Summary
Railswaycon 2009 - Summary
daniel.mattes
 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
tomaspavelka
 

Similar to Rails testing environment, 2009 fall (20)

New features in abap
New features in abapNew features in abap
New features in abap
 
And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
11.11.22 かなり役立つ競技プログラミング
11.11.22 かなり役立つ競技プログラミング11.11.22 かなり役立つ競技プログラミング
11.11.22 かなり役立つ競技プログラミング
 
Railswaycon 2009 - Summary
Railswaycon 2009 - SummaryRailswaycon 2009 - Summary
Railswaycon 2009 - Summary
 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
 
RoR 101: Session 1
RoR 101: Session 1RoR 101: Session 1
RoR 101: Session 1
 
Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....
 
Sinatra
SinatraSinatra
Sinatra
 
Ruby 1.9
Ruby 1.9Ruby 1.9
Ruby 1.9
 
How to eat Cucmber
How to eat CucmberHow to eat Cucmber
How to eat Cucmber
 
All about Erubis (English)
All about Erubis (English)All about Erubis (English)
All about Erubis (English)
 
Ruby DSL
Ruby DSLRuby DSL
Ruby DSL
 
Ruby sittin' on the Couch
Ruby sittin' on the CouchRuby sittin' on the Couch
Ruby sittin' on the Couch
 
Gemboys
GemboysGemboys
Gemboys
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)
 
Ruby Xml Mapping
Ruby Xml MappingRuby Xml Mapping
Ruby Xml Mapping
 
Impacta - Show Day de Rails
Impacta - Show Day de RailsImpacta - Show Day de Rails
Impacta - Show Day de Rails
 
RSpec
RSpecRSpec
RSpec
 
RubyConf Bangladesh 2017 - Craft beautiful code with Ruby DSL
RubyConf Bangladesh 2017 - Craft beautiful code with Ruby DSLRubyConf Bangladesh 2017 - Craft beautiful code with Ruby DSL
RubyConf Bangladesh 2017 - Craft beautiful code with Ruby DSL
 

More from Kyosuke MOROHASHI

Test Context Arrangement Recipebook
Test Context Arrangement RecipebookTest Context Arrangement Recipebook
Test Context Arrangement Recipebook
Kyosuke MOROHASHI
 

More from Kyosuke MOROHASHI (10)

Introduction HTTP via cURL
Introduction HTTP via cURLIntroduction HTTP via cURL
Introduction HTTP via cURL
 
Ruby ecosystem applied to agile project
Ruby ecosystem applied to agile projectRuby ecosystem applied to agile project
Ruby ecosystem applied to agile project
 
Test Context Arrangement Recipebook
Test Context Arrangement RecipebookTest Context Arrangement Recipebook
Test Context Arrangement Recipebook
 
Begin cucumber-in-real-world
Begin cucumber-in-real-worldBegin cucumber-in-real-world
Begin cucumber-in-real-world
 
Cucumber in Practice(en)
Cucumber in Practice(en)Cucumber in Practice(en)
Cucumber in Practice(en)
 
TDD frameworks let me dream "Project Specific Language"
TDD frameworks let me dream "Project Specific Language"TDD frameworks let me dream "Project Specific Language"
TDD frameworks let me dream "Project Specific Language"
 
Rails Tokyo 035 Cucumber
Rails Tokyo 035 CucumberRails Tokyo 035 Cucumber
Rails Tokyo 035 Cucumber
 
OSC2008 勉強会大集合 Rails勉強会@東京
OSC2008 勉強会大集合 Rails勉強会@東京OSC2008 勉強会大集合 Rails勉強会@東京
OSC2008 勉強会大集合 Rails勉強会@東京
 
named_scope more detail
named_scope more detailnamed_scope more detail
named_scope more detail
 
Rails <form> Chronicle
Rails <form> ChronicleRails <form> Chronicle
Rails <form> Chronicle
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Rails testing environment, 2009 fall

  • 1. 2009 2009-10-31 OSC 2009 Tokyo/Fall Rails 2009 11 2
  • 2. (::) 2009 11 2
  • 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. 2009 Rails ✓ ✓ ✓ 2009 11 2
  • 5. (::) 2009 11 2
  • 6. http://d.hatena.ne.jp/moro/ ✓ ✓ ✓http://ruby.agile.esm.co.jp/ 2009 11 2
  • 8. 2009 11 2
  • 9. (::) 2009 11 2
  • 10. 2008-10 Ruby 01 2009 11 2
  • 11. Cucumber&RSpec ✓ ✓ 2009 11 2
  • 12. (::) 2009 11 2
  • 14. Cucumber ✓ ✓ 2009 11 2
  • 15. 2009 11 2
  • 16. Execute Plain Text ✓ “features” ✓ ✓ “step_definitions” ✓ features Ruby 2009 11 2
  • 17. 2009 11 2
  • 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. # 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
  • 21. Rails ✓ ✓ ✓ 2009 11 2
  • 22. (::) 2009 11 2
  • 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. RSpec ✓ ✓ ✓ 2009 11 2
  • 26. subject { } ✓ its(:attr){ } 2009 11 2
  • 27. subject { } ✓ Example(it) (=subject) ✓it{ } should ✓subject{ } should 2009 11 2
  • 28. describe Array do before do @arr = [1,2,3] end it{ @arr.should have(3).items } end 2009 11 2
  • 29. describe Array do before do @arr = [1,2,3] end subject{ @arr } it{ should have(3).items } end 2009 11 2
  • 30. before ✓ before {} ✓ subject{} 2009 11 2
  • 31. its() ✓ 1.2.9 ✓ subject{} its() send 2009 11 2
  • 32. describe Array do before do @arr = [1,2,3] end subject{ @arr.size } it{ should == 3 } end 2009 11 2
  • 33. describe Array do before do @arr = [1,2,3] end subject{ @arr } its(:size){ should == 3 } end 2009 11 2
  • 34. ✓ subject ✓ ✓ CustomMatcher 2009 11 2
  • 35. RSpec ✓ ✓ ✓ 2009 11 2
  • 36. Rails ✓ ✓ ✓ ✓ 2009 11 2
  • 37. (::) 2009 11 2
  • 38. 2009 Rails ✓ ✓ ✓ 2009 11 2
  • 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
  • 41. 2009 11 2