Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1082 Bytes
1 | require File.dirname(__FILE__) + "/../spec_helper" |
2 | |
3 | class Dumbo |
4 | include Simpleton |
5 | end |
6 | |
7 | describe Simpleton, "when included in a class" do |
8 | |
9 | it "should add an 'instance' class method" do |
10 | Dumbo.should respond_to(:instance) |
11 | end |
12 | |
13 | end |
14 | |
15 | describe Simpleton, "when creating or invoking the instance" do |
16 | |
17 | before :each do |
18 | Dumbo.class_eval { @instance = nil } |
19 | end |
20 | |
21 | it "should return the instance of the class" do |
22 | Dumbo.instance.should be_instance_of(Dumbo) |
23 | end |
24 | |
25 | it "should accept a block and yield the instance" do |
26 | Dumbo.instance do |i| |
27 | i.should be_instance_of(Dumbo) |
28 | i.should == Dumbo.class_eval { @instance } |
29 | end |
30 | end |
31 | |
32 | end |
33 | |
34 | describe Simpleton, "when invoking methods" do |
35 | |
36 | it "should delegate missing class methods to the instance" do |
37 | Dumbo.class_eval { def an_instance_method; :success; end } |
38 | Dumbo.an_instance_method.should == :success |
39 | end |
40 | |
41 | it "should not delegate missing class methods that are not defined on the instance" do |
42 | lambda { Dumbo.missing_instance_method }.should raise_error(NoMethodError) |
43 | end |
44 | |
45 | end |