Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 13 lines (13 sloc) 0.397 kb
d8c2d5f8 »
2010-12-02 Rename from Plastic to Bendy.
1 module Bendy
830ae98a »
2010-12-02 Implement a simple mock object called Shape.
2 module Shape
5d10a41d »
2010-12-02 Add support for defining the class of a shape.
3 def shape(*args)
9ebdc68d »
2013-12-19 Always subclass so stubbed methods don't persist.
4 klass = args[0].kind_of?(Class) ? Class.new(args.shift) : Class.new
1f879abb »
2013-08-30 Allow arguments to be passed to initialize.
5 methods = args[-1].kind_of?(Hash) ? args.pop : {}
6 methods.each do |attribute, value|
7 proc = value.kind_of?(Proc) ? value : Proc.new { |*args| value }
a98d4e1d »
2010-12-03 Optimillisize the shape implementation.
8 klass.send(:define_method, attribute, &proc)
830ae98a »
2010-12-02 Implement a simple mock object called Shape.
9 end
1f879abb »
2013-08-30 Allow arguments to be passed to initialize.
10 klass.new(*args)
830ae98a »
2010-12-02 Implement a simple mock object called Shape.
11 end
12 end
1f879abb »
2013-08-30 Allow arguments to be passed to initialize.
13 end
Something went wrong with that request. Please try again.