GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
cleaned up default foundation test a wee bit.
automatthew (author)
Thu May 15 13:29:30 -0700 2008
commit  4ae32ebe880da70b79028a2d0ff58861a8071e02
tree    327aab3da3a258183b0e0876314b2b40eeadfa1d
parent  b57612786f085f1aa1270c00412441e73dcd1998
...
5
6
7
 
8
9
10
11
12
13
14
15
16
17
18
19
 
 
 
 
 
 
 
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
39
40
41
42
 
43
44
45
46
47
48
49
50
 
 
 
 
51
52
53
...
5
6
7
8
9
10
11
12
 
 
 
 
 
 
 
 
13
14
15
16
17
18
19
20
21
22
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
45
46
47
48
49
 
 
 
 
50
51
52
53
54
55
56
0
@@ -5,49 +5,52 @@ require 'layers/orm/sequel'
0
 Dir.chdir File.dirname(__FILE__) / "default_application" do
0
 module DefaultApplication ; include Waves::Foundations::Default ; end
0
 Waves::Console.load( :mode => :development )
0
+DA = DefaultApplication
0
 
0
   describe "An application module which includes the Simple foundation" do
0
 
0
     it "should have basic submodules defined" do
0
- DefaultApplication::Configurations::Mapping
0
- DefaultApplication::Configurations::Default.host.should == nil
0
- DefaultApplication::Configurations::Development.host.should == '127.0.0.1'
0
- DefaultApplication::Models::Default
0
- DefaultApplication::Views::Default
0
- DefaultApplication::Controllers::Default
0
- DefaultApplication::Helpers::Default
0
- DefaultApplication::Helpers::Testing
0
+ DA::Configurations::Mapping
0
+ DA::Configurations::Default.host.should == nil
0
+ DA::Configurations::Development.host.should == '127.0.0.1'
0
+ DA::Models::Default
0
+ DA::Views::Default
0
+ DA::Controllers::Default
0
+ DA::Helpers::Default
0
+ DA::Helpers::Testing
0
     end
0
 
0
     it "should auto_load Helpers, Models, Views, and Controllers when their files exist" do
0
- DefaultApplication::Helpers::Default.instance_methods.should.include "layout"
0
- DefaultApplication::Helpers::Testing.instance_methods.should.include "layout"
0
- DefaultApplication::Helpers::Testing.should.respond_to :foundation_testing
0
- DefaultApplication::Models::Default.should.respond_to :crayola
0
- DefaultApplication::Models::Default.should.respond_to :set_dataset
0
- DefaultApplication::Models::Different.should.respond_to :sargent
0
- DefaultApplication::Models::Different.should.respond_to :set_dataset
0
- DefaultApplication::Controllers::Default.instance_methods.should.include "attributes"
0
- DefaultApplication::Controllers::Default.instance_methods.should.include "destroy_all"
0
- DefaultApplication::Controllers::Different.instance_methods.should.include "attributes"
0
- DefaultApplication::Controllers::Different.instance_methods.should.include "destroy_all"
0
- DefaultApplication::Views::Default.instance_methods.should.include "renderer"
0
- DefaultApplication::Views::Default.instance_methods.should.include "upside_down"
0
- DefaultApplication::Views::Different.instance_methods.should.include "renderer"
0
- DefaultApplication::Views::Different.instance_methods.should.include "upside_down"
0
+ Waves::Application.instance.mapping.send(:mapping).should.not.be.empty
0
+ DA::Helpers::Default.instance_methods.should.include "layout"
0
+ DA::Helpers::Testing.instance_methods.should.include "layout"
0
+ DA::Helpers::Testing.should.respond_to :foundation_testing
0
+ DA::Models::Default.should.respond_to :crayola
0
+ DA::Models::Default.dataset.to_table_reference.should == "(SELECT * FROM defaults)"
0
+ DA::Models::Mocker.dataset.to_table_reference.should == "(SELECT * FROM mockers)"
0
+ DA::Models::Different.should.respond_to :sargent
0
+ DA::Models::Different.should.respond_to :set_dataset
0
+ DA::Controllers::Default.instance_methods.should.include "attributes"
0
+ DA::Controllers::Default.instance_methods.should.include "destroy_all"
0
+ DA::Controllers::Different.instance_methods.should.include "attributes"
0
+ DA::Controllers::Different.instance_methods.should.include "destroy_all"
0
+ DA::Views::Default.instance_methods.should.include "renderer"
0
+ DA::Views::Default.instance_methods.should.include "upside_down"
0
+ DA::Views::Different.instance_methods.should.include "renderer"
0
+ DA::Views::Different.instance_methods.should.include "upside_down"
0
     end
0
 
0
     it "should have accessors defined" do
0
       [ :database, :config, :configurations, :controllers, :models, :helpers, :views ].each do |method|
0
- DefaultApplication.should.respond_to method
0
+ DA.should.respond_to method
0
       end
0
     end
0
 
0
     it "should define [] method for appropriate submodules" do
0
- DefaultApplication::Configurations.should.respond_to :[]
0
- DefaultApplication::Models.should.respond_to :[]
0
- DefaultApplication::Views.should.respond_to :[]
0
- DefaultApplication::Controllers.should.respond_to :[]
0
+ DA::Configurations.should.respond_to :[]
0
+ DA::Models.should.respond_to :[]
0
+ DA::Views.should.respond_to :[]
0
+ DA::Controllers.should.respond_to :[]
0
     end
0
 
0
   end
...
2
3
4
5
6
 
7
8
9
...
2
3
4
 
 
5
6
7
8
0
@@ -2,8 +2,7 @@ module DefaultApplication
0
   module Configurations
0
     class Development < Default
0
 
0
- database :host => 'localhost', :adapter => 'sqlite', :database => 'defaultapplication',
0
- :user => 'root', :password => ''
0
+ database :adapter => 'sqlite', :database => 'defaultapplication.db'
0
 
0
       reloadable [ DefaultApplication ]
0
 
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@ module DefaultApplication
0
 
0
     module Mapping
0
       extend Waves::Mapping
0
- # your custom rules go here
0
+ path( "/user-added") { response.body = "User added mapping"}
0
       include Waves::Mapping::PrettyUrls::RestRules
0
       include Waves::Mapping::PrettyUrls::GetRules
0
     end

Comments

    No one has commented yet.