ramaze 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/bin/ramaze +58 -26
  2. data/doc/AUTHORS +2 -0
  3. data/doc/CHANGELOG +401 -0
  4. data/doc/README +14 -9
  5. data/doc/README.html +737 -0
  6. data/doc/TODO +14 -14
  7. data/doc/changes.txt +401 -0
  8. data/doc/changes.xml +401 -0
  9. data/doc/meta/announcement.txt +28 -15
  10. data/doc/meta/configuration.txt +3 -3
  11. data/doc/meta/internals.txt +2 -2
  12. data/doc/meta/users.kml +62 -0
  13. data/doc/readme_chunks/examples.txt +1 -1
  14. data/doc/readme_chunks/features.txt +13 -8
  15. data/doc/tutorial/todolist.html +2 -2
  16. data/doc/tutorial/todolist.mkd +2 -2
  17. data/examples/blog/README +3 -0
  18. data/examples/blog/spec/blog.rb +101 -0
  19. data/examples/blog/{main.rb → start.rb} +0 -0
  20. data/examples/caching.rb +16 -5
  21. data/examples/layout.rb +41 -0
  22. data/examples/templates/template_amrita2.rb +1 -1
  23. data/examples/templates/template_erubis.rb +1 -1
  24. data/examples/templates/template_ezamar.rb +1 -1
  25. data/examples/templates/template_haml.rb +1 -1
  26. data/examples/templates/template_liquid.rb +1 -1
  27. data/examples/templates/template_markaby.rb +1 -1
  28. data/examples/templates/template_remarkably.rb +1 -1
  29. data/examples/todolist/README +1 -0
  30. data/{spec/examples → examples/todolist/spec}/todolist.rb +3 -3
  31. data/examples/todolist/{main.rb → start.rb} +0 -0
  32. data/examples/whywiki/{main.rb → start.rb} +0 -0
  33. data/examples/wiktacular/README +2 -0
  34. data/examples/wiktacular/spec/wiktacular.rb +146 -0
  35. data/examples/wiktacular/src/controller.rb +11 -0
  36. data/examples/wiktacular/src/model.rb +5 -1
  37. data/examples/wiktacular/{main.rb → start.rb} +0 -1
  38. data/examples/wiktacular/template/edit.xhtml +1 -2
  39. data/examples/wiktacular/template/html_layout.xhtml +27 -0
  40. data/examples/wiktacular/template/index.xhtml +8 -10
  41. data/examples/wiktacular/template/new.xhtml +1 -2
  42. data/lib/proto/{main.rb → start.rb} +0 -0
  43. data/lib/proto/template/index.xhtml +1 -1
  44. data/lib/ramaze/action/render.rb +58 -4
  45. data/lib/ramaze/action.rb +20 -0
  46. data/lib/ramaze/adapter/cgi.rb +7 -4
  47. data/lib/ramaze/adapter/fcgi.rb +6 -4
  48. data/lib/ramaze/adapter/mongrel.rb +4 -0
  49. data/lib/ramaze/adapter/webrick.rb +20 -9
  50. data/lib/ramaze/adapter.rb +3 -1
  51. data/lib/ramaze/cache/memcached.rb +2 -26
  52. data/lib/ramaze/cache.rb +8 -4
  53. data/lib/ramaze/controller/resolve.rb +26 -8
  54. data/lib/ramaze/controller.rb +44 -7
  55. data/lib/ramaze/dispatcher/action.rb +5 -1
  56. data/lib/ramaze/dispatcher/directory.rb +115 -0
  57. data/lib/ramaze/dispatcher/error.rb +19 -5
  58. data/lib/ramaze/dispatcher/file.rb +2 -2
  59. data/lib/ramaze/dispatcher.rb +52 -39
  60. data/lib/ramaze/global/dsl.rb +3 -2
  61. data/lib/ramaze/global/globalstruct.rb +26 -4
  62. data/lib/ramaze/global.rb +20 -11
  63. data/lib/ramaze/helper/aspect.rb +29 -11
  64. data/lib/ramaze/helper/auth.rb +2 -2
  65. data/lib/ramaze/helper/cache.rb +2 -0
  66. data/lib/ramaze/helper/identity.rb +21 -6
  67. data/lib/ramaze/helper/link.rb +1 -1
  68. data/lib/ramaze/helper/pager.rb +158 -100
  69. data/lib/ramaze/helper/partial.rb +22 -0
  70. data/lib/ramaze/helper/redirect.rb +1 -2
  71. data/lib/ramaze/helper/stack.rb +1 -1
  72. data/lib/ramaze/inform/informer.rb +20 -0
  73. data/lib/ramaze/inform/syslog.rb +5 -0
  74. data/lib/ramaze/snippets/kernel/__dir__.rb +21 -0
  75. data/lib/ramaze/snippets/kernel/aquire.rb +22 -12
  76. data/lib/ramaze/snippets/numeric/human_readable_filesize_format.rb +33 -0
  77. data/lib/ramaze/snippets/ramaze/caller_lines.rb +1 -1
  78. data/lib/ramaze/snippets/struct/values_at.rb +11 -4
  79. data/lib/ramaze/sourcereload.rb +29 -1
  80. data/{spec → lib/ramaze/spec}/helper/context.rb +0 -0
  81. data/{spec → lib/ramaze/spec}/helper/layout.rb +1 -1
  82. data/{spec → lib/ramaze/spec}/helper/minimal.rb +0 -0
  83. data/{spec → lib/ramaze/spec}/helper/mock_http.rb +0 -0
  84. data/{spec → lib/ramaze/spec}/helper/requester.rb +0 -0
  85. data/{spec → lib/ramaze/spec}/helper/simple_http.rb +0 -0
  86. data/{spec → lib/ramaze/spec}/helper/wrap.rb +0 -0
  87. data/lib/ramaze/spec/helper.rb +60 -0
  88. data/lib/ramaze/store/default.rb +3 -0
  89. data/lib/ramaze/template/ezamar/render_partial.rb +3 -0
  90. data/lib/ramaze/template/sass.rb +45 -0
  91. data/lib/ramaze/template.rb +1 -1
  92. data/lib/ramaze/tool/create.rb +5 -5
  93. data/lib/ramaze/tool/localize.rb +26 -5
  94. data/lib/ramaze/tool/mime.rb +7 -0
  95. data/lib/ramaze/trinity/response.rb +15 -0
  96. data/lib/ramaze/trinity/session.rb +1 -1
  97. data/lib/ramaze/version.rb +1 -1
  98. data/lib/ramaze.rb +5 -0
  99. data/rake_tasks/conf.rake +4 -4
  100. data/rake_tasks/maintaince.rake +12 -7
  101. data/rake_tasks/spec.rake +7 -4
  102. data/spec/examples/caching.rb +6 -8
  103. data/spec/helper.rb +3 -60
  104. data/spec/ramaze/action/basics.rb +17 -0
  105. data/spec/ramaze/action/cache.rb +28 -0
  106. data/spec/ramaze/action/layout.rb +110 -0
  107. data/spec/ramaze/action/render.rb +14 -0
  108. data/spec/ramaze/action/template/bar.xhtml +1 -0
  109. data/spec/ramaze/action/template/other_wrapper.xhtml +1 -0
  110. data/spec/ramaze/action/template/single_wrapper.xhtml +1 -0
  111. data/spec/ramaze/controller/template/edit/content.xhtml +1 -0
  112. data/spec/ramaze/controller/template/edit.xhtml +1 -0
  113. data/spec/ramaze/controller/template_resolving.rb +2 -2
  114. data/spec/ramaze/dispatcher/directory.rb +53 -0
  115. data/spec/ramaze/dispatcher/file.rb +0 -3
  116. data/spec/ramaze/error.rb +17 -2
  117. data/spec/ramaze/helper/aspect.rb +14 -20
  118. data/spec/ramaze/helper/pager.rb +83 -1
  119. data/spec/ramaze/helper/partial.rb +1 -1
  120. data/spec/ramaze/helper/template/test_template.xhtml +1 -0
  121. data/spec/ramaze/inform/informer.rb +37 -5
  122. data/spec/ramaze/localize.rb +1 -1
  123. data/spec/ramaze/template/haml.rb +5 -5
  124. data/spec/ramaze/template/sass/file.css.sass +5 -0
  125. data/spec/ramaze/template/sass.rb +46 -0
  126. data/spec/ramaze/template.rb +1 -1
  127. data/spec/ramaze/trinity/session.rb +27 -0
  128. data/spec/snippets/kernel/__dir__.rb +8 -0
  129. data/spec/snippets/kernel/aquire.rb +71 -0
  130. data/spec/snippets/kernel/constant.rb +27 -0
  131. data/spec/snippets/numeric/human_readable_filesize_format.rb +11 -0
  132. data/spec/snippets/ramaze/caller_info.rb +39 -0
  133. data/spec/snippets/ramaze/caller_lines.rb +27 -0
  134. data/spec/snippets/string/DIVIDE.rb +18 -0
  135. data/spec/snippets/string/camel_case.rb +25 -0
  136. data/spec/snippets/string/color.rb +11 -0
  137. data/spec/snippets/string/snake_case.rb +17 -0
  138. data/spec/snippets/struct/fill.rb +27 -0
  139. data/spec/snippets/struct/values_at.rb +39 -0
  140. metadata +71 -31
  141. data/examples/todolist/todolist.db +0 -5
  142. data/examples/wiktacular/src/page.rb +0 -66
  143. data/lib/ramaze/helper/feed.rb +0 -135
  144. data/lib/ramaze/helper/form.rb +0 -204
  145. data/lib/ramaze/snippets/openstruct/temp.rb +0 -13
  146. data/lib/ramaze/store/yaml.rb +0 -170
  147. data/spec/ramaze/helper/feed.rb +0 -127
  148. data/spec/ramaze/helper/form.rb +0 -146
  149. data/spec/ramaze/store/yaml.rb +0 -76
@@ -6,7 +6,7 @@ require 'spec/helper'
6
6
  class TCPartialHelperController < Ramaze::Controller
7
7
  map '/'
8
8
  helper :partial
9
- template_root(File.dirname(__FILE__)/:template)
9
+ template_root(__DIR__/:template)
10
10
 
11
11
  def index
12
12
  '<html><head><title>#{render_partial("/title")}</title></head></html>'
@@ -0,0 +1 @@
1
+ I am a template.
@@ -9,23 +9,23 @@ describe 'Informer' do
9
9
  end
10
10
 
11
11
  def format(tag, string)
12
- "[#{@inform.timestamp}] #{tag.to_s.upcase.ljust(5)} #{string}"
12
+ /\[\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\] #{tag.to_s.upcase.ljust(5)} #{Regexp.escape(string)}/
13
13
  end
14
14
 
15
15
  it 'info' do
16
16
  @inform.info('Some Info')
17
- @out.first.should == format(:info, 'Some Info')
17
+ @out.first.should =~ format(:info, 'Some Info')
18
18
  end
19
19
 
20
20
  it 'debug' do
21
21
  arr = [:some, :stuff]
22
22
  @inform.debug(arr)
23
- @out.first.should == format(:debug, arr.inspect)
23
+ @out.first.should =~ format(:debug, arr.inspect)
24
24
  end
25
25
 
26
26
  it 'warn' do
27
27
  @inform.warn('More things')
28
- @out.first.should == format(:warn, 'More things')
28
+ @out.first.should =~ format(:warn, 'More things')
29
29
  end
30
30
 
31
31
  it 'error' do
@@ -35,6 +35,38 @@ describe 'Informer' do
35
35
  end
36
36
 
37
37
  @inform.error(ex)
38
- @out.first.should == format(:error, ex.inspect)
38
+ @out.first.should =~ format(:error, ex.inspect)
39
39
  end
40
+
41
+ it 'should choose stdout on init(stdout,:stdout,STDOUT)' do
42
+ a = Ramaze::Informer.new(STDOUT)
43
+ b = Ramaze::Informer.new(:stdout)
44
+ c = Ramaze::Informer.new('stdout')
45
+ [a,b,c].each { |x| x.out.should == $stdout}
46
+ end
47
+
48
+ it 'should choose stderr on init(stderr,:stderr,STDERR)' do
49
+ a = Ramaze::Informer.new(STDERR)
50
+ b = Ramaze::Informer.new(:stderr)
51
+ c = Ramaze::Informer.new('stderr')
52
+ [a,b,c].each { |x| x.out.should == $stderr}
53
+ end
54
+
55
+ it 'should use IO when supplied' do
56
+ i = Ramaze::Informer.new(s = StringIO.new)
57
+ i.out.should == s
58
+ end
59
+
60
+ it 'should open file otherwise' do
61
+ begin
62
+ i = Ramaze::Informer.new('tmp.dummy')
63
+ out = i.out
64
+ out.should be_an_instance_of(File)
65
+ out.path.should == 'tmp.dummy'
66
+ ensure
67
+ out.close
68
+ File.delete('tmp.dummy')
69
+ end
70
+ end
71
+
40
72
  end
@@ -27,7 +27,7 @@ end
27
27
 
28
28
  describe "Localize" do
29
29
  before :all do
30
- @dir = File.join(File.dirname(__FILE__), 'conf')
30
+ @dir = __DIR__ / :conf
31
31
  FileUtils.mkdir_p(@dir)
32
32
 
33
33
  dict = {
@@ -20,21 +20,21 @@ class TCTemplateHamlController < Ramaze::Controller
20
20
  end
21
21
  end
22
22
 
23
- describe "Simply calling" do
23
+ describe "Haml templates" do
24
24
  ramaze(:compile => true)
25
25
 
26
- it "index" do
26
+ it "should render" do
27
27
  get('/').body.strip.should ==
28
- "<div id='contact'>
28
+ %{<div id='contact'>
29
29
  <h1>Eugene Mumbai</h1>
30
30
  <ul class='info'>
31
31
  <li class='login'>eugene</li>
32
32
  <li class='email'>eugene@example.com</li>
33
33
  </ul>
34
- </div>"
34
+ </div>}
35
35
  end
36
36
 
37
- it "variables in controller" do
37
+ it "should have access to variables defined in controller" do
38
38
  get('/with_vars').body.strip.should ==
39
39
  %{<div id='content'>
40
40
  <div class='title'>
@@ -0,0 +1,5 @@
1
+ body
2
+ :margin 1em
3
+
4
+ #content
5
+ :text-align center
@@ -0,0 +1,46 @@
1
+ # Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require 'spec/helper'
5
+
6
+ testcase_requires 'sass/engine'
7
+
8
+ class TCTemplateSassController < Ramaze::Controller
9
+ map '/'
10
+ template_root 'spec/ramaze/template/sass/'
11
+ trait :engine => Ramaze::Template::Sass
12
+
13
+ define_method('style.css') do
14
+ %{
15
+ body
16
+ :margin 1em
17
+
18
+ #content
19
+ :text-align center
20
+ }
21
+ end
22
+ end
23
+
24
+ describe "Sass templates" do
25
+ ramaze(:compile => true)
26
+
27
+ it "should render inline" do
28
+ r = get('/style.css')
29
+ r.headers['Content-Type'].should == "text/css"
30
+ r.body.strip.should ==
31
+ "body {
32
+ margin: 1em; }
33
+ body #content {
34
+ text-align: center; }"
35
+ end
36
+
37
+ it "should render from file" do
38
+ r = get('/file.css')
39
+ r.headers['Content-Type'].should == "text/css"
40
+ r.body.strip.should ==
41
+ "body {
42
+ margin: 1em; }
43
+ body #content {
44
+ text-align: center; }"
45
+ end
46
+ end
@@ -21,7 +21,7 @@ end
21
21
  class TCTemplateController < Ramaze::Controller
22
22
  map '/'
23
23
  trait :engine => Ramaze::Template::TestTemplate
24
- template_root(File.dirname(__FILE__)/:template/:ramaze)
24
+ template_root(__DIR__/:template/:ramaze)
25
25
 
26
26
  def index *args
27
27
  end
@@ -0,0 +1,27 @@
1
+ # Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require 'spec/helper'
5
+
6
+ class TrinitySessionController < Ramaze::Controller
7
+ map :/
8
+
9
+ def index
10
+ "nothing"
11
+ end
12
+ end
13
+
14
+ describe "Session" do
15
+ before(:all){
16
+ Ramaze::Global.sessions = false
17
+ ramaze
18
+ }
19
+
20
+ it 'should work without sessions' do
21
+ (Ramaze::Session::IP_COUNT_LIMIT + 2).times do
22
+ r = get('/')
23
+ r.body.should == "nothing"
24
+ r.headers.should == {'Content-Type' => 'text/html'}
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec/helper'
2
+
3
+ describe '__DIR__' do
4
+ # this is hardly exhaustive, but better tha anything
5
+ it 'should report the directory of the current file' do
6
+ __DIR__.should == File.dirname(File.expand_path(__FILE__))
7
+ end
8
+ end
@@ -0,0 +1,71 @@
1
+ require 'spec/helper'
2
+
3
+ describe 'aquire' do
4
+ def require(name)
5
+ @required << name
6
+ end
7
+
8
+ before :all do
9
+ FileUtils.mkdir_p 'tmp_dir_for_aquire/sub'
10
+ FileUtils.touch 'tmp_dir_for_aquire/foo.rb'
11
+ FileUtils.touch 'tmp_dir_for_aquire/bar.rb'
12
+ FileUtils.touch 'tmp_dir_for_aquire/baz.so'
13
+ FileUtils.touch 'tmp_dir_for_aquire/baz.yml'
14
+ FileUtils.touch 'tmp_dir_for_aquire/sub/baz.rb'
15
+ end
16
+
17
+ before do
18
+ @required = []
19
+ end
20
+
21
+ it 'should not load a single file' do
22
+ aquire 'tmp_dir_for_aquire/foo'
23
+ @required.should == []
24
+ end
25
+
26
+ it 'should load dir' do
27
+ aquire 'tmp_dir_for_aquire/sub/*'
28
+ @required.should == ['tmp_dir_for_aquire/sub/baz.rb']
29
+ end
30
+
31
+ it 'should load {so,rb}, not others' do
32
+ aquire 'tmp_dir_for_aquire/*'
33
+ @required.sort.should == %w{
34
+ tmp_dir_for_aquire/bar.rb
35
+ tmp_dir_for_aquire/baz.so
36
+ tmp_dir_for_aquire/foo.rb}
37
+
38
+ end
39
+
40
+ it 'should use globbing' do
41
+ aquire 'tmp_dir_for_aquire/ba*'
42
+ @required.sort.should == %w{
43
+ tmp_dir_for_aquire/bar.rb
44
+ tmp_dir_for_aquire/baz.so}
45
+
46
+ end
47
+
48
+ it 'should use recursive globbing' do
49
+ aquire 'tmp_dir_for_aquire/**/*'
50
+ @required.sort.should == %w{
51
+ tmp_dir_for_aquire/bar.rb
52
+ tmp_dir_for_aquire/baz.so
53
+ tmp_dir_for_aquire/foo.rb
54
+ tmp_dir_for_aquire/sub/baz.rb}
55
+
56
+ end
57
+
58
+ it 'should accept multiple arguments' do
59
+ aquire 'tmp_dir_for_aquire/*', 'tmp_dir_for_aquire/sub/*'
60
+ @required.sort.should == %w{
61
+ tmp_dir_for_aquire/bar.rb
62
+ tmp_dir_for_aquire/baz.so
63
+ tmp_dir_for_aquire/foo.rb
64
+ tmp_dir_for_aquire/sub/baz.rb}
65
+
66
+ end
67
+
68
+ after :all do
69
+ FileUtils.rm_rf('tmp_dir_for_aquire')
70
+ end
71
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec/helper'
2
+
3
+ describe 'constant' do
4
+
5
+
6
+ it 'should load from string' do
7
+ constant('Fixnum').should == Fixnum
8
+ end
9
+
10
+ it 'should load from symbol' do
11
+ constant(:Fixnum).should == Fixnum
12
+ end
13
+
14
+ it 'should handle hierarchy' do
15
+ constant('Ramaze::Inform').should == Ramaze::Inform
16
+ end
17
+
18
+ it 'should be callable with explicit self' do
19
+ Ramaze.constant('Inform').should == Ramaze::Inform
20
+ end
21
+
22
+ it 'should be callable with explicit self' do
23
+ Ramaze.constant('::Ramaze').should == Ramaze
24
+ end
25
+
26
+ end
27
+
@@ -0,0 +1,11 @@
1
+ require 'spec/helper'
2
+
3
+ describe "Numeric#human_readable_filesize_format" do
4
+ it 'it should convert filesizes to human readable format' do
5
+ 1.human_readable_filesize_format.should == '1'
6
+ 1024.human_readable_filesize_format.should == '1.0K'
7
+ (1 << 20).human_readable_filesize_format.should == '1.0M'
8
+ (1 << 30).human_readable_filesize_format.should == '1.0G'
9
+ (1 << 40).human_readable_filesize_format.should == '1.0T'
10
+ end
11
+ end
@@ -0,0 +1,39 @@
1
+ require 'spec/helper'
2
+
3
+ #TODO test parse_backtrace explicitly
4
+ describe "Ramaze#caller_info" do
5
+
6
+ def foo(n=0)
7
+ Ramaze.caller_info(n)
8
+ end
9
+
10
+ def bar
11
+ foo
12
+ end
13
+
14
+ def baz
15
+ foo(1)
16
+ end
17
+
18
+ it "should report correct informations" do
19
+ file,line,meth=foo()
20
+ file.should == __FILE__
21
+ line.should match(/\d+/)
22
+ meth.should == 'foo'
23
+ end
24
+
25
+ it "should report correct informations on nested defs" do
26
+ file,line,meth=bar()
27
+ file.should == __FILE__
28
+ line.should match(/\d+/)
29
+ meth.should == 'foo'
30
+ end
31
+
32
+ it "should report correct informations on other callers" do
33
+ file,line,meth=baz()
34
+ file.should == __FILE__
35
+ line.should match(/\d+/)
36
+ meth.should == 'baz'
37
+ end
38
+
39
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec/helper'
2
+
3
+ describe "Ramaze#caller_info" do
4
+
5
+ it 'should show line numbers' do
6
+ res = Ramaze.caller_lines('/usr/lib/ruby/1.8/debug.rb', 122, 2)
7
+ res.size.should == 5
8
+ res.map {|e| e[0]}.should == (120..124).to_a
9
+ end
10
+
11
+ it 'should show which line we asked for' do
12
+ res = Ramaze.caller_lines('/usr/lib/ruby/1.8/debug.rb', 122, 2)
13
+ res.size.should == 5
14
+ res.map {|e| e[2]}.should == [false,false,true,false,false]
15
+ end
16
+
17
+ it 'should show the code' do
18
+ res = Ramaze.caller_lines(__FILE__, __LINE__, 1)
19
+ res.size.should == 3
20
+ res.map {|e| e[1].strip}.should == [
21
+ "it 'should show the code' do",
22
+ "res = Ramaze.caller_lines(__FILE__, __LINE__, 1)",
23
+ "res.size.should == 3"
24
+ ]
25
+ end
26
+
27
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec/helper'
2
+
3
+ describe 'String#/' do
4
+
5
+ # check if this is ok in win32
6
+ it 'should join two strings' do
7
+ ('a' / 'b').should == 'a/b'
8
+ end
9
+
10
+ it 'should join a string and a symbol' do
11
+ ('a' / :b).should == 'a/b'
12
+ end
13
+
14
+ it 'should be usable in concatenation' do
15
+ ('a' / :b / :c).should == 'a/b/c'
16
+ end
17
+
18
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec/helper'
2
+
3
+ describe "String#camel_case" do
4
+
5
+ it 'should camelize snake_case' do
6
+ 'foo_bar'.camel_case.should == 'FooBar'
7
+ end
8
+
9
+ it 'should camelize snake_case_long' do
10
+ 'foo_bar_baz'.camel_case.should == 'FooBarBaz'
11
+ end
12
+
13
+ it 'should ignore starting _' do
14
+ '_foo_bar_baz'.camel_case.should == 'FooBarBaz'
15
+ end
16
+
17
+ it 'should ignore trailing _' do
18
+ 'foo_bar_baz_'.camel_case.should == 'FooBarBaz'
19
+ end
20
+
21
+ it 'messes up existing CamelCase' do
22
+ 'foo_barBaz'.camel_case.should == 'FooBarbaz'
23
+ end
24
+
25
+ end