diff options
author | Hans de Graaff <graaff@gentoo.org> | 2010-08-29 10:28:27 +0000 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2010-08-29 10:28:27 +0000 |
commit | 8dd37b7a867342c0541797850f26fbf43a9b104f (patch) | |
tree | 8aed5466ad8388e8e4301247e151f2c5c96b52c8 | |
parent | new maintainers: wired and hwoarang (diff) | |
download | gentoo-2-8dd37b7a867342c0541797850f26fbf43a9b104f.tar.gz gentoo-2-8dd37b7a867342c0541797850f26fbf43a9b104f.tar.bz2 gentoo-2-8dd37b7a867342c0541797850f26fbf43a9b104f.zip |
Fix broken tests due to new haml 3 with upstream patch.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
-rw-r--r-- | dev-ruby/sinatra/ChangeLog | 6 | ||||
-rw-r--r-- | dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch | 106 | ||||
-rw-r--r-- | dev-ruby/sinatra/sinatra-1.0.ebuild | 7 |
3 files changed, 116 insertions, 3 deletions
diff --git a/dev-ruby/sinatra/ChangeLog b/dev-ruby/sinatra/ChangeLog index 79af0d004d3c..cbb5b494de40 100644 --- a/dev-ruby/sinatra/ChangeLog +++ b/dev-ruby/sinatra/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-ruby/sinatra # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/sinatra/ChangeLog,v 1.10 2010/08/11 05:36:54 graaff Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/sinatra/ChangeLog,v 1.11 2010/08/29 10:28:27 graaff Exp $ + + 29 Aug 2010; Hans de Graaff <graaff@gentoo.org> sinatra-1.0.ebuild, + +files/sinatra-1.0-haml3-tests.patch: + Fix broken tests due to new haml 3 with upstream patch. 11 Aug 2010; Hans de Graaff <graaff@gentoo.org> -sinatra-0.9.4.ebuild, -sinatra-0.9.4-r1.ebuild: diff --git a/dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch b/dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch new file mode 100644 index 000000000000..de41fb066f07 --- /dev/null +++ b/dev-ruby/sinatra/files/sinatra-1.0-haml3-tests.patch @@ -0,0 +1,106 @@ +commit b5bc740c12024df855991ae7437ef2df113d1ab3 +Author: Simon Rozet <simon@rozet.name> +Date: Wed May 12 07:11:05 2010 +0200 + + fix test for haml 3 + +diff --git a/test/sass_test.rb b/test/sass_test.rb +index 200554c..596e3c4 100644 +--- a/test/sass_test.rb ++++ b/test/sass_test.rb +@@ -13,21 +13,21 @@ class SassTest < Test::Unit::TestCase + end + + it 'renders inline Sass strings' do +- sass_app { sass "#sass\n :background-color #FFF\n" } ++ sass_app { sass "#sass\n :background-color white\n" } + assert ok? +- assert_equal "#sass {\n background-color: #FFF; }\n", body ++ assert_equal "#sass {\n background-color: white; }\n", body + end + + it 'renders .sass files in views path' do + sass_app { sass :hello } + assert ok? +- assert_equal "#sass {\n background-color: #FFF; }\n", body ++ assert_equal "#sass {\n background-color: white; }\n", body + end + + it 'ignores the layout option' do + sass_app { sass :hello, :layout => :layout2 } + assert ok? +- assert_equal "#sass {\n background-color: #FFF; }\n", body ++ assert_equal "#sass {\n background-color: white; }\n", body + end + + it "raises error if template not found" do +@@ -39,44 +39,50 @@ class SassTest < Test::Unit::TestCase + + it "passes SASS options to the Sass engine" do + sass_app { +- sass "#sass\n :background-color #FFF\n :color #000\n", :style => :compact ++ sass "#sass\n :background-color white\n :color black\n", ++ :style => :compact + } + assert ok? +- assert_equal "#sass { background-color: #FFF; color: #000; }\n", body ++ assert_equal "#sass { background-color: white; color: black; }\n", body + end + + it "passes default SASS options to the Sass engine" do + mock_app { + set :sass, {:style => :compact} # default Sass style is :nested + get '/' do +- sass "#sass\n :background-color #FFF\n :color #000\n" ++ sass "#sass\n :background-color white\n :color black\n" + end + } + get '/' + assert ok? +- assert_equal "#sass { background-color: #FFF; color: #000; }\n", body ++ assert_equal "#sass { background-color: white; color: black; }\n", body + end + +- it "merges the default SASS options with the overrides and passes them to the Sass engine" do ++ it "merges the default SASS options with the overrides" do + mock_app { +- set :sass, {:style => :compact, :attribute_syntax => :alternate } # default Sass attribute_syntax is :normal (with : in front) ++ # default Sass attribute_syntax is :normal (with : in front) ++ set :sass, {:style => :compact, :attribute_syntax => :alternate } + get '/' do +- sass "#sass\n background-color: #FFF\n color: #000\n" ++ sass "#sass\n background-color: white\n color: black\n" + end + get '/raised' do +- sass "#sass\n :background-color #FFF\n :color #000\n", :style => :expanded # retains global attribute_syntax settings ++ # retains global attribute_syntax settings ++ sass "#sass\n :background-color white\n :color black\n", ++ :style => :expanded + end + get '/expanded_normal' do +- sass "#sass\n :background-color #FFF\n :color #000\n", :style => :expanded, :attribute_syntax => :normal ++ sass "#sass\n :background-color white\n :color black\n", ++ :style => :expanded, :attribute_syntax => :normal + end + } + get '/' + assert ok? +- assert_equal "#sass { background-color: #FFF; color: #000; }\n", body ++ assert_equal "#sass { background-color: white; color: black; }\n", body + assert_raise(Sass::SyntaxError) { get('/raised') } + get '/expanded_normal' + assert ok? +- assert_equal "#sass {\n background-color: #FFF;\n color: #000;\n}\n", body ++ assert_equal "#sass {\n background-color: white;\n color: black;\n}\n", ++ body + end + end + +diff --git a/test/views/hello.sass b/test/views/hello.sass +index 5a4fd57..090bd4a 100644 +--- a/test/views/hello.sass ++++ b/test/views/hello.sass +@@ -1,2 +1,2 @@ + #sass +- :background-color #FFF ++ :background-color white diff --git a/dev-ruby/sinatra/sinatra-1.0.ebuild b/dev-ruby/sinatra/sinatra-1.0.ebuild index dcd8dd4edf6f..735b3f8d9d93 100644 --- a/dev-ruby/sinatra/sinatra-1.0.ebuild +++ b/dev-ruby/sinatra/sinatra-1.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/sinatra/sinatra-1.0.ebuild,v 1.5 2010/06/30 06:47:02 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/sinatra/sinatra-1.0.ebuild,v 1.6 2010/08/29 10:28:27 graaff Exp $ EAPI=2 USE_RUBY="ruby18" @@ -21,10 +21,13 @@ KEYWORDS="~amd64 ~x86" IUSE="" ruby_add_rdepend '>=dev-ruby/rack-1.0' -ruby_add_bdepend "test? ( dev-ruby/rack-test dev-ruby/haml dev-ruby/erubis dev-ruby/builder )" +ruby_add_bdepend "test? ( dev-ruby/rack-test >=dev-ruby/haml-3.0 dev-ruby/erubis dev-ruby/builder )" each_ruby_prepare() { # Remove tests for optional templating system which is not # available in Gentoo. rm test/less_test.rb || die + + # Fix tests with haml3. + epatch "${FILESDIR}/${P}-haml3-tests.patch" } |