Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
machinist but just for hashes and arrays
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
LICENSE
README.md
Rakefile
french_man.gemspec

README.md

French Man

Hash and object mocking

Basic Example

groceries = FrenchMan::Grocery.blueprint {
  garlic { true }
}

groceries.garlic #=> true
groceries[:garlic] #=> true

Bigger Example

groceries = FrenchMan::Grocery.plan {
  vino {
    FrenchMan::Vino.plan {
      red { "Syrah" }
      white { "Cabernet Sauvignon" }
    }
  }
  cheeses {
    ['Camembert', 'Crotin du Chavignol']
  }
}

groceries.vino.red #=> "Syrah"

Hash Example

groceries = FrenchMan::Grocery.plan :vino => { :red => "Syrah", :white => "Cabernet Sauvignon"}

groceries.vino.red #=> "Syrah"
Something went wrong with that request. Please try again.