machinist but just for hashes and arrays
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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"