This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts 'Hello World! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Card | |
| CLUB = "\u2663" | |
| DIAMOND = "\u2666" | |
| SPADE = "\u2660" | |
| HEART = "\u2764" | |
| attr_reader :suit, :value | |
| def initialize(suit, value) | |
| @suit = suit | |
| @value = value.to_s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts "This is line one" | |
| puts "This is line one" | |
| puts "This is line one" | |
| puts "This is line one" | |
| puts "This is line one" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts "This is line one" | |
| puts "This is line one" | |
| puts "This is line one" | |
| puts "This is line one" | |
| puts "This is line one" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Cat | |
| def speak | |
| "meow" | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rake test:all_versions | |
| warning: parser/current is loading parser/ruby21, which recognizes | |
| warning: 2.1.5-compliant syntax, but you are running 2.1.2. | |
| Warning: unrecognized cop Metrics/AbcSize found in /Users/jasonn/workspace/guard-rspec/.rubocop_todo.yml | |
| Warning: unrecognized cop Metrics/AbcSize found in /Users/jasonn/workspace/guard-rspec/.hound.yml | |
| Inspecting 31 files | |
| ............................... | |
| 31 files inspected, no offenses detected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rails g rspec:install | |
| /Users/jasonn/.rvm/gems/ruby-2.1.4@rails4/gems/guard-rspec-4.4.1/lib/guard/rspec/options.rb:2:in `<module:Guard>': uninitialized constant Guard::Plugin (NameError) | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@rails4/gems/guard-rspec-4.4.1/lib/guard/rspec/options.rb:1:in `<top (required)>' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@rails4/gems/guard-rspec-4.4.1/lib/guard/rspec.rb:1:in `require' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@rails4/gems/guard-rspec-4.4.1/lib/guard/rspec.rb:1:in `<top (required)>' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.4/lib/bundler/runtime.rb:85:in `require' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.4/lib/bundler/runtime.rb:85:in `rescue in block in require' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.4/lib/bundler/runtime.rb:68:in `block in require' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@global/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `each' | |
| from /Users/jasonn/.rvm/gems/ruby-2.1.4@globa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FactoryGirl.define do | |
| factory :car do | |
| make { Car::MAKES_AND_MODELS.keys.sample } | |
| model { Car::MAKES_AND_MODELS[make].sample } | |
| year { rand(1879..2014) } | |
| price { | |
| if [ | |
| "Aston Martin", "Bentley", "Ferrari", | |
| "Lamborghini", "Maserati", "Maybach", "Rolls-Royce" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MAKES_AND_MODELS = {"Acura"=>["MDX", "NSX", "RL", "RSX", "TL", "TSX"], "Aston Martin"=>["DB9", "V12 Vanquish"], "Audi"=>["A4", "A6", "A8", "S4", "TT", "allroad quattro"], "BMW"=>["3 Series", "5 Series", "6 Series", "7 Series", "M3", "X3", "X5", "Z4"], "Bentley"=>["Arnage", "Continental GT"], "Buick"=>["Century", "LaCrosse", "LeSabre", "Park Avenue", "Rainier", "Rendezvous", "Terraza"], "Cadillac"=>["CTS", "CTS-V", "DeVille", "Escalade", "Escalade ESV", "Escalade EXT", "SRX", "STS", "XLR"], "Chevrolet"=>["Astro", "Astro Cargo", "Avalanche", "Aveo", "Blazer", "Cavalier", "Classic", "Cobalt", "Colorado", "Corvette", "Equinox", "Express", "Express Cargo", "Impala", "Malibu", "Malibu Maxx", "Monte Carlo", "SSR", "Silverado 1500", "Silverado 1500HD", "Silverado 2500HD", "Silverado 3500", "Suburban", "Tahoe", "TrailBlazer", "TrailBlazer EXT", "Uplander", "Venture"], "Chrysler"=>["300", "Crossfire", "PT Cruiser", "Pacifica", "Sebring", "Town and Country"], "Dodge"=>["Caravan", "Dakota", "Durango", "Grand Caravan", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rspec' | |
| require_relative '../../lib/to_english' | |
| describe Fixnum do | |
| describe '#to_english' do | |
| it 'returns one for 1' do | |
| expect(1.to_english).to eq('one') | |
| end | |
| it 'returns two for 2' do | |
| expect(2.to_english).to eq('two') |