Your SlideShare is downloading. ×
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Intro to Ruby (and RSpec)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Intro to Ruby (and RSpec)

1,305

Published on

An introduction to the Ruby language and RSpec

An introduction to the Ruby language and RSpec

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

  • Be the first to like this

No Downloads
Views
Total Views
1,305
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. THE RUBY LANGUAGE
    • 2. THE RUBY LANGUAGE• Originally by Yukihiro "Matz" Matsumoto• “Ruby is designed for programmer productivity and fun, following the principles of good user interface design. He stresses that systems design needs to emphasize human, rather than computer, needs.” http://en.wikipedia.org/wiki/Ruby_(programming_language)#History• Ruby 1.0 was released in 1996.
    • 3. RUBY LANGUAGE OVERVIEW• Dynamically typed• Interpreted• Can be modified at runtime• Object oriented• Blocks & lambdas• Nice support for Regular Expressions
    • 4. RUBY VERSIONSruby -v•1.8.6 – Still around but mostly supplanted by 1.8.7•1.8.7 – some 1.9 features, compatible w/ 1.8.6•1.9.2 – latest version, many VMs, Rails 2.3+
    • 5. RUBY VMS• MRI (Matzs Ruby Interpreter) the original Ruby, default for 1.8• YARV (yet another Ruby VM) faster than MRI, default for 1.9• JRuby (Java)• Rubinius (pure ruby)• IronRuby (.NET)• MacRuby, HotCocoa• HotRuby/RubyJS (Flash/Javascript)
    • 6. LETS GET STARTED• IRB: InteractiveRuBy>> 4>> 4 + 4
    • 7. EVERYTHING IS AN OBJECT“test”.upcase“test”.class“test”.methods
    • 8. EVERYTHING EVALUATES TO SOMETHING2+2(2+2).zero?
    • 9. METHODS ARE MESSAGESthing.do(4)thing.do 4thing.send “do”, 4
    • 10. OPERATORS ARE METHODSthing.do 4 3+2thing.do(4) 3.+(2)thing.send “do”, 4 3.send "+", 2
    • 11. DEFINING CLASSES• Let’s write some code!
    • 12. INTRODUCTION TO RSPEC• Describe the feature• Verify expectation
    • 13. RSPEC SYNTAXdescribe Something doend
    • 14. RSPEC SYNTAXdescribe Something do it "should do whatever it should do"end
    • 15. RSPEC SYNTAXdescribe Something do it "should do whatever it should do" do endend
    • 16. RSPEC SYNTAXdescribe Something do it "should do whatever it should do" do s = Something.new endend
    • 17. RSPEC SYNTAXdescribe Something do it "should do whatever it should do" do s = Something.new s.do_whatever(3, 2, 1) endend
    • 18. RSPEC SYNTAXdescribe Something do it "should do whatever it should do" do s = Something.new s.do_whatever(3, 2, 1).should == "blast off!" endend
    • 19. RSPEC SYNTAXdescribe Something do it "should do whatever it should do" do s = Something.new s.do_whatever(3, 2, 1).should == "blast off!" endend
    • 20. • Lets try it!

    ×