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

public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Click here to lend your support to: mack and make a donation at www.pledgie.com !
Cleaned up spec tests.
markbates (author)
Sat Jul 05 07:55:52 -0700 2008
commit  b4f0706d5e2ef3662b91e3f047bf9db885ee0977
tree    a4791f6b9d10fb49590f4ec220c427c7025fe460
parent  c944d90e386cad88e48306ae905fbeeccae9057c
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 # This is a sample rspec file. You can safely delete this file.
0
 require File.join(File.dirname(__FILE__), "..", "spec_helper.rb")
0
 
0
-describe "My first Mack application" do
0
+describe DefaultController do
0
   it "should be able to successfully connect to home page" do
0
     get home_page_url
0
     assert_response :success
...
28
29
30
31
32
 
33
34
35
36
37
38
...
122
123
124
125
126
127
128
129
...
156
157
158
 
159
...
28
29
30
 
 
31
32
33
 
34
35
36
...
120
121
122
 
 
123
124
125
...
152
153
154
155
156
0
@@ -28,11 +28,9 @@ class WantsTestController
0
 end
0
 
0
 
0
-describe "Base Controller" do
0
- # include Assertions
0
+describe Mack::Controller do
0
   
0
   before(:all) do
0
- puts "building routes"
0
     Mack::Routes.build do |r|
0
       r.you_want_what "/yww", :controller => "wants_test", :action => :you_want_what
0
       r.on_disk_wants "/odw", :controller => "wants_test", :action => :on_disk_wants
0
@@ -122,8 +120,6 @@ describe "Base Controller" do
0
     get "/tst_another/no_action_in_cont_served_from_public"
0
     assert_response :success
0
     response.body.should match(/hello from: no_action_in_cont_served_from_public/)
0
- # because it's being served from the public directory we shouldn't wrap a layout around it.
0
- # assert !response.body.match("<title>Application Layout</title>")
0
   end
0
   
0
   it "should render from public folder if there's no controller associated with the action" do
0
@@ -156,4 +152,5 @@ describe "Base Controller" do
0
     assert_response :success
0
     response.body.should match(/Hello World/)
0
   end
0
+
0
 end
...
1
2
3
4
5
 
6
7
8
...
15
16
17
 
18
...
1
2
3
 
 
4
5
6
7
...
14
15
16
17
18
0
@@ -1,8 +1,7 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
-describe "Cookie Jar" do
0
- # include Assertions
0
+describe Mack::CookieJar do
0
   
0
   it "should be able to set 1 cookie" do
0
     get "/tst_home_page/write_cookie?bourne=the_bourne_identity"
0
@@ -15,4 +14,5 @@ describe "Cookie Jar" do
0
     assert_cookie(:bourne, "the_bourne_identity")
0
     assert_cookie(:woody, "annie_hall")
0
   end
0
+
0
 end
...
30
31
32
33
 
34
35
36
...
30
31
32
 
33
34
35
36
0
@@ -30,7 +30,7 @@ class BottomController < MiddleController
0
   end
0
 end
0
 
0
-describe "Filter Inheritance" do
0
+describe "Mack::Controller::Filter Inheritance" do
0
   
0
   before(:all) do
0
     Mack::Routes.build do |r|
...
4
5
6
7
 
8
9
 
10
11
12
...
35
36
37
38
 
 
39
40
41
...
70
71
72
 
73
74
75
 
 
76
77
78
...
82
83
84
 
85
86
87
 
88
89
90
...
105
106
107
 
108
 
109
110
...
4
5
6
 
7
8
 
9
10
11
12
...
35
36
37
 
38
39
40
41
42
...
71
72
73
74
75
76
 
77
78
79
80
81
...
85
86
87
88
89
90
 
91
92
93
94
...
109
110
111
112
113
114
115
116
0
@@ -4,9 +4,9 @@ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 class Foo
0
 end
0
 
0
-describe "Filter" do
0
+describe Mack::Controller::Filter do
0
 
0
- describe "->before" do
0
+ describe "before" do
0
     # def test_before_all_actions
0
     # end
0
     it "should handle before_all actions" do
0
@@ -35,7 +35,8 @@ describe "Filter" do
0
     end
0
   end
0
 
0
- describe "->run" do
0
+ describe "run" do
0
+
0
     before(:all) do
0
       @filter = Mack::Controller::Filter
0
     end
0
@@ -70,9 +71,11 @@ describe "Filter" do
0
       f.run?(:my_other_action).should_not == true
0
       f.run?(:some_other_action).should == true
0
     end
0
+
0
   end
0
 
0
- describe "->after" do
0
+ describe "after" do
0
+
0
     it "should handle after_filter simple :only" do
0
       get "/tst_my_filters/me"
0
       response.body.should match(/'ME'/)
0
@@ -82,9 +85,10 @@ describe "Filter" do
0
       get "/tst_my_filters/make_all_a"
0
       response.body.should match(/aaa/)
0
     end
0
+
0
   end
0
 
0
- describe "->misc" do
0
+ describe "misc" do
0
 
0
     it "should respond to to_s" do
0
       f = Mack::Controller::Filter.new(:log_action, Foo)
0
@@ -105,6 +109,8 @@ describe "Filter" do
0
     it "should raise error if false filter is called" do
0
       lambda { get "/tst_my_filters/please_blow_up" }.should raise_error(Mack::Errors::FilterChainHalted)
0
     end
0
+
0
   end
0
+
0
 end
0
 
...
2
3
4
 
5
6
7
...
2
3
4
5
6
7
8
0
@@ -2,6 +2,7 @@ require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
 describe "Layout" do
0
+
0
   it "should use default layout" do
0
     get hello_world_url
0
     response.body.should match(//)
...
21
22
23
24
 
25
26
 
27
28
29
30
31
32
 
33
34
35
...
53
54
55
 
56
57
 
 
58
59
60
...
69
70
71
 
72
 
73
...
21
22
23
 
24
25
 
26
27
28
29
30
31
32
33
34
35
36
...
54
55
56
57
58
 
59
60
61
62
63
...
72
73
74
75
76
77
78
0
@@ -21,15 +21,16 @@ class MimeController
0
 
0
 end
0
 
0
-describe "MIME Types" do
0
+describe Mack::Utils::MimeTypes do
0
   
0
- describe "=> Pre-defined Types" do
0
+ describe "Pre-defined Types" do
0
     
0
     before(:each) do
0
       Mack::Routes.build do |r|
0
         r.marceau "/marceau/marceau", :controller => "mime"
0
       end
0
     end
0
+
0
     it "should handle HTML type" do
0
       get(marceau_url(:format => :html))
0
       response.body.should match(/HTML/)
0
@@ -53,8 +54,10 @@ describe "MIME Types" do
0
       response.body.should match(/JPG/)
0
       response["Content-Type"].should == "image/jpeg; image/pjpeg"
0
     end
0
+
0
   end
0
- describe "=> Newly Defined Types" do
0
+
0
+ describe "Newly Defined Types" do
0
     
0
     before(:each) do
0
       Mack::Routes.build do |r|
0
@@ -69,5 +72,7 @@ describe "MIME Types" do
0
       response.body.should match(/IPHONE/)
0
       response["Content-Type"].should == "app/iphone; application/mac-iphone"
0
     end
0
+
0
   end
0
+
0
 end
...
1
2
3
4
 
 
5
6
7
...
1
2
3
 
4
5
6
7
8
0
@@ -1,7 +1,8 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
-describe "Uploaded Files" do
0
+describe Mack::Request::UploadedFile do
0
+
0
   before(:each) do
0
     FileUtils.cp(File.join(Mack::Configuration.root, "public", "images", "logo.gif"),
0
                  File.join(Mack::Configuration.root, "public", "something", "logo.gif"))
...
19
20
21
22
 
23
24
 
 
25
26
27
...
29
30
31
 
32
33
34
35
...
19
20
21
 
22
23
 
24
25
26
27
28
...
30
31
32
33
34
35
36
37
0
@@ -19,9 +19,10 @@ module Mack
0
   end
0
 end
0
 
0
-describe "Kernel Extension" do
0
+describe Kernel do
0
   
0
- describe "=> Encryption Engine" do
0
+ describe "Encryption Engine" do
0
+
0
     it "should be able to encrypt text using the reverse worker" do
0
       _encrypt("hello world", :reverse).should == "dlrow olleh"
0
     end
0
@@ -29,6 +30,7 @@ describe "Kernel Extension" do
0
     it "should be able to decrypt text using the reverse worker" do
0
       _decrypt("dlrow olleh", :reverse).should == "hello world"
0
     end
0
+
0
   end
0
   
0
 end
0
\ No newline at end of file
...
1
2
3
4
 
5
6
 
 
7
8
9
10
11
12
 
13
14
15
...
1
2
3
 
4
5
 
6
7
8
9
10
11
12
13
14
15
16
17
0
@@ -1,15 +1,17 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
-describe "String Extensions" do
0
+describe String do
0
   
0
- describe "=> Encryption Engine" do
0
+ describe "Encryption Engine" do
0
+
0
     it "should be able to encrypt/decrypt string" do
0
       raw_value = "hello world"
0
       encrypted_value = raw_value.encrypt
0
       encrypted_value.should_not == raw_value
0
       raw_value.should == encrypted_value.decrypt
0
     end
0
+
0
   end
0
   
0
 end
...
1
2
3
4
 
5
6
7
...
57
58
59
60
 
 
61
...
1
2
3
 
4
5
6
7
...
57
58
59
 
60
61
62
0
@@ -1,7 +1,7 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
0
 
0
-describe "D-Route" do
0
+describe "droute_url" do
0
   
0
   before(:all) do
0
     begin
0
@@ -57,4 +57,5 @@ describe "D-Route" do
0
       droute_url(:known_app, :known_url).should be_nil
0
     end
0
   end
0
-end
0
+
0
+end
0
\ No newline at end of file
...
3
4
5
6
 
 
7
8
9
...
56
57
58
59
 
 
60
...
3
4
5
 
6
7
8
9
10
...
57
58
59
 
60
61
62
0
@@ -3,7 +3,8 @@ require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
0
 require 'rinda/ring'
0
 require 'rinda/tuplespace'
0
 
0
-describe "Rinda" do
0
+describe Mack::Distributed::Utils::Rinda do
0
+
0
   before(:all) do
0
     begin
0
       DRb.start_service
0
@@ -56,4 +57,5 @@ describe "Rinda" do
0
     serv.should == str2
0
     serv.should_not == str
0
   end
0
-end
0
+
0
+end
0
\ No newline at end of file
...
3
4
5
6
 
 
7
8
9
...
19
20
21
 
22
23
24
...
3
4
5
 
6
7
8
9
10
...
20
21
22
23
24
25
26
0
@@ -3,7 +3,8 @@ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
 describe "Configuration" do
0
   
0
- describe "=> Existence Check" do
0
+ describe "Existence Check" do
0
+
0
     it "should have valid reference to app_config" do
0
       app_config.should_not be_nil
0
     end
0
@@ -19,6 +20,7 @@ describe "Configuration" do
0
     it "should return valid reference if requested config key is valid" do
0
       app_config.mack.cache_classes.should == true
0
     end
0
+
0
   end
0
   
0
 end
...
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
 
 
11
12
13
...
17
18
19
20
21
22
 
 
 
23
24
25
...
35
36
37
38
39
 
 
40
41
 
 
 
 
42
 
43
44
 
 
45
...
1
2
3
 
 
 
 
 
 
 
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
22
23
24
 
 
 
25
26
27
28
29
30
...
40
41
42
 
 
43
44
45
 
46
47
48
49
50
51
52
 
53
54
55
0
@@ -1,13 +1,18 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
0
 
0
-describe "Generator Tasks" do
0
- it "should generate a list of tasks" do
0
- rake_task("generator:list") do
0
- ENV["__generator_list"].should_not be_nil
0
-
0
- if app_config.orm.nil?
0
- list = <<-LIST
0
+describe "rake" do
0
+
0
+ describe "generator" do
0
+
0
+ describe "list" do
0
+
0
+ it "should generate a list of tasks" do
0
+ rake_task("generator:list") do
0
+ ENV["__generator_list"].should_not be_nil
0
+
0
+ if app_config.orm.nil?
0
+ list = <<-LIST
0
 
0
 Available Generators:
0
 
0
@@ -17,9 +22,9 @@ PluginGenerator
0
   rake generate:plugin_generator
0
 
0
 
0
- LIST
0
- else
0
- list = <<-LIST
0
+ LIST
0
+ else
0
+ list = <<-LIST
0
 
0
 Available Generators:
0
 
0
@@ -35,10 +40,15 @@ ScaffoldGenerator
0
   rake generate:scaffold_generator
0
 
0
 
0
- LIST
0
- end
0
+ LIST
0
+ end
0
 
0
- ENV["__generator_list"].should == list
0
+ ENV["__generator_list"].should == list
0
+ end
0
+ end
0
+
0
     end
0
+
0
   end
0
-end
0
+
0
+end
0
\ No newline at end of file
...
2
3
4
 
5
6
7
...
20
21
22
 
23
...
2
3
4
5
6
7
8
...
21
22
23
24
25
0
@@ -2,6 +2,7 @@ require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
0
 
0
 describe "Task Helper" do
0
+
0
   it "should handle rake_task" do
0
     old_user = ENV["USER"]
0
     old_user.should_not == "foobar"
0
@@ -20,4 +21,5 @@ describe "Task Helper" do
0
     ENV["USER"].should_not == "foobar"
0
     ENV["USER"].should == old_user
0
   end
0
+
0
 end
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent.parent.parent + 'spec_helper'
0
 
0
-describe "Encryption Engine" do
0
+describe Mack::Utils::Crypt do
0
   
0
   it "should be able to encrypt/decrypt using default worker" do
0
     Mack::Utils::Crypt::Keeper.instance.worker.is_a?(Mack::Utils::Crypt::DefaultWorker).should == true
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
0
 
0
-describe "Gem Manager" do
0
+describe Mack::Utils::GemManager do
0
   include CommonHelpers
0
   
0
   before(:each) do
...
1
2
3
4
 
5
6
7
...
35
36
37
 
38
...
1
2
3
 
4
5
6
7
...
35
36
37
38
39
0
@@ -1,7 +1,7 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent.parent.parent + 'spec_helper'
0
 
0
-describe "Plugin Generator" do
0
+describe PluginGenerator do
0
   
0
   after(:all) do
0
     clean_bandit_dir
0
@@ -35,4 +35,5 @@ describe "Plugin Generator" do
0
   def bandit_dir
0
     File.join(Mack::Configuration.plugins, "bandit")
0
   end
0
+
0
 end
...
1
2
3
4
 
5
6
 
7
8
9
...
21
22
23
 
24
25
26
 
 
27
28
29
...
34
35
36
 
37
 
38
39
...
1
2
3
 
4
5
 
6
7
8
9
...
21
22
23
24
25
26
 
27
28
29
30
31
...
36
37
38
39
40
41
42
43
0
@@ -1,9 +1,9 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
-describe "Rendering Engine Registry" do
0
+describe Mack::Rendering::Engine::Registry do
0
   
0
- describe "=> register new engine" do
0
+ describe "register" do
0
     
0
     before(:all) do
0
       @reg = Mack::Rendering::Engine::Registry
0
@@ -21,9 +21,11 @@ describe "Rendering Engine Registry" do
0
     it "should be return correct engine when passed a valid key" do
0
       @reg.engines[:foo].should == [:erb]
0
     end
0
+
0
   end
0
   
0
- describe "=> register existing engine" do
0
+ describe "register existing engine" do
0
+
0
     before(:all) do
0
       @reg = Mack::Rendering::Engine::Registry
0
     end
0
@@ -34,5 +36,7 @@ describe "Rendering Engine Registry" do
0
       @reg.register(:bar, :sass)
0
       @reg.engines[:bar].should == [:sass, :erb]
0
     end
0
+
0
   end
0
+
0
 end
0
\ No newline at end of file
...
4
5
6
 
7
8
9
...
4
5
6
7
8
9
10
0
@@ -4,6 +4,7 @@ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 describe "render(:action)" do
0
   
0
   describe "erb" do
0
+
0
     include ContentValidationHelper
0
     
0
     before(:all) do
...
2
3
4
5
 
 
 
6
7
8
...
12
13
14
 
15
 
16
17
...
2
3
4
 
5
6
7
8
9
10
...
14
15
16
17
18
19
20
21
0
@@ -2,7 +2,9 @@ require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
 describe "render(:partial)" do
0
- describe "ERB" do
0
+
0
+ describe "erb" do
0
+
0
     it "should be able to handle outside partial" do
0
       get partial_outside_url
0
       response.body.should == "Hi from the outside partial"
0
@@ -12,5 +14,7 @@ describe "render(:partial)" do
0
       get partial_local_url
0
       response.body.should == "Hi from the local partial"
0
     end
0
+
0
   end
0
+
0
 end
0
\ No newline at end of file
...
1
2
3
4
 
5
6
7
...
22
23
24
 
25
...
1
2
3
 
4
5
6
7
...
22
23
24
25
26
0
@@ -1,7 +1,7 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
-describe "public render" do
0
+describe "render(:public)" do
0
   include CommonHelpers
0
   
0
   it "should render file from public if it exists" do
0
@@ -22,4 +22,5 @@ describe "public render" do
0
     get public_with_extension_url
0
     response.body == "hello from /public/vtt/vtt_public_with_extension_test.txt"
0
   end
0
+
0
 end
...
28
29
30
 
31
...
28
29
30
31
32
0
@@ -28,4 +28,5 @@ describe "render(:url)" do
0
       lambda { post bad_url_post_with_raise_url }.should raise_error(Mack::Errors::UnsuccessfulRenderUrl)
0
     end
0
   end
0
+
0
 end
...
23
24
25
 
26
27
...
23
24
25
26
27
28
0
@@ -23,5 +23,6 @@ describe "render(:xml)" do
0
     get homer_xml_without_layout_url
0
     validate_content_and_type(@base_dir, "xml_without_layout.txt", :xml)
0
   end
0
+
0
 end
0
 
...
34
35
36
37
38
39
40
...
53
54
55
56
57
 
 
58
...
34
35
36
 
37
38
39
...
52
53
54
 
 
55
56
57
0
@@ -34,7 +34,6 @@ end
0
 
0
 
0
 describe "Routes Exceptions" do
0
- # include Assertions
0
   
0
   before(:all) do
0
     Mack::Routes.build do |r|
0
@@ -53,5 +52,5 @@ describe "Routes Exceptions" do
0
   it "should not catch and handle a raised exception if it's not supposed to" do
0
     lambda { get raise_drunk_url }.should raise_error(DrunkError)
0
   end
0
-end
0
-
0
+
0
+end
0
\ No newline at end of file
...
1
2
3
4
5
 
 
6
7
8
...
61
62
63
 
64
...
1
2
3
 
 
4
5
6
7
8
...
61
62
63
64
65
0
@@ -1,8 +1,8 @@
0
 require 'pathname'
0
 require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
0
 
0
-describe "Route Map" do
0
- # include Assertions
0
+describe Mack::Routes::RouteMap do
0
+
0
   it "should route to homepage" do
0
     get "/"
0
     response.body.should match(/tst_home_page: index/)
0
@@ -61,4 +61,5 @@ describe "Route Map" do
0
     post "/pickles", {:id => 1, :pickles => big_text}
0
     response.body.should match(/tst_another_controller: foo: id: '1' pickles: '#{big_text}'/)
0
   end
0
+
0
 end