Gentoo Archives: gentoo-commits

From: "Hans de Graaff (graaff)" <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-ruby/sinatra/files: sinatra-1.0-haml3-tests.patch
Date: Sun, 29 Aug 2010 10:28:32
Message-Id: 20100829102827.6591B20054@flycatcher.gentoo.org
1 graaff 10/08/29 10:28:27
2
3 Added: sinatra-1.0-haml3-tests.patch
4 Log:
5 Fix broken tests due to new haml 3 with upstream patch.
6 (Portage version: 2.1.8.3/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch?rev=1.1&content-type=text/plain
13
14 Index: sinatra-1.0-haml3-tests.patch
15 ===================================================================
16 commit b5bc740c12024df855991ae7437ef2df113d1ab3
17 Author: Simon Rozet <simon@×××××.name>
18 Date: Wed May 12 07:11:05 2010 +0200
19
20 fix test for haml 3
21
22 diff --git a/test/sass_test.rb b/test/sass_test.rb
23 index 200554c..596e3c4 100644
24 --- a/test/sass_test.rb
25 +++ b/test/sass_test.rb
26 @@ -13,21 +13,21 @@ class SassTest < Test::Unit::TestCase
27 end
28
29 it 'renders inline Sass strings' do
30 - sass_app { sass "#sass\n :background-color #FFF\n" }
31 + sass_app { sass "#sass\n :background-color white\n" }
32 assert ok?
33 - assert_equal "#sass {\n background-color: #FFF; }\n", body
34 + assert_equal "#sass {\n background-color: white; }\n", body
35 end
36
37 it 'renders .sass files in views path' do
38 sass_app { sass :hello }
39 assert ok?
40 - assert_equal "#sass {\n background-color: #FFF; }\n", body
41 + assert_equal "#sass {\n background-color: white; }\n", body
42 end
43
44 it 'ignores the layout option' do
45 sass_app { sass :hello, :layout => :layout2 }
46 assert ok?
47 - assert_equal "#sass {\n background-color: #FFF; }\n", body
48 + assert_equal "#sass {\n background-color: white; }\n", body
49 end
50
51 it "raises error if template not found" do
52 @@ -39,44 +39,50 @@ class SassTest < Test::Unit::TestCase
53
54 it "passes SASS options to the Sass engine" do
55 sass_app {
56 - sass "#sass\n :background-color #FFF\n :color #000\n", :style => :compact
57 + sass "#sass\n :background-color white\n :color black\n",
58 + :style => :compact
59 }
60 assert ok?
61 - assert_equal "#sass { background-color: #FFF; color: #000; }\n", body
62 + assert_equal "#sass { background-color: white; color: black; }\n", body
63 end
64
65 it "passes default SASS options to the Sass engine" do
66 mock_app {
67 set :sass, {:style => :compact} # default Sass style is :nested
68 get '/' do
69 - sass "#sass\n :background-color #FFF\n :color #000\n"
70 + sass "#sass\n :background-color white\n :color black\n"
71 end
72 }
73 get '/'
74 assert ok?
75 - assert_equal "#sass { background-color: #FFF; color: #000; }\n", body
76 + assert_equal "#sass { background-color: white; color: black; }\n", body
77 end
78
79 - it "merges the default SASS options with the overrides and passes them to the Sass engine" do
80 + it "merges the default SASS options with the overrides" do
81 mock_app {
82 - set :sass, {:style => :compact, :attribute_syntax => :alternate } # default Sass attribute_syntax is :normal (with : in front)
83 + # default Sass attribute_syntax is :normal (with : in front)
84 + set :sass, {:style => :compact, :attribute_syntax => :alternate }
85 get '/' do
86 - sass "#sass\n background-color: #FFF\n color: #000\n"
87 + sass "#sass\n background-color: white\n color: black\n"
88 end
89 get '/raised' do
90 - sass "#sass\n :background-color #FFF\n :color #000\n", :style => :expanded # retains global attribute_syntax settings
91 + # retains global attribute_syntax settings
92 + sass "#sass\n :background-color white\n :color black\n",
93 + :style => :expanded
94 end
95 get '/expanded_normal' do
96 - sass "#sass\n :background-color #FFF\n :color #000\n", :style => :expanded, :attribute_syntax => :normal
97 + sass "#sass\n :background-color white\n :color black\n",
98 + :style => :expanded, :attribute_syntax => :normal
99 end
100 }
101 get '/'
102 assert ok?
103 - assert_equal "#sass { background-color: #FFF; color: #000; }\n", body
104 + assert_equal "#sass { background-color: white; color: black; }\n", body
105 assert_raise(Sass::SyntaxError) { get('/raised') }
106 get '/expanded_normal'
107 assert ok?
108 - assert_equal "#sass {\n background-color: #FFF;\n color: #000;\n}\n", body
109 + assert_equal "#sass {\n background-color: white;\n color: black;\n}\n",
110 + body
111 end
112 end
113
114 diff --git a/test/views/hello.sass b/test/views/hello.sass
115 index 5a4fd57..090bd4a 100644
116 --- a/test/views/hello.sass
117 +++ b/test/views/hello.sass
118 @@ -1,2 +1,2 @@
119 #sass
120 - :background-color #FFF
121 + :background-color white