Skip to content

Commit

Permalink
Merge remote-tracking branch 'pwnall/ruby-18' into 3-1-stable
Browse files Browse the repository at this point in the history
* pwnall/ruby-18:
  Fix 1.8-specific test failures.
  • Loading branch information
chriseppstein committed Jul 22, 2011
2 parents 3babfd6 + fc31e11 commit 28a7410
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -4,6 +4,7 @@ source "http://rubygems.org"
gemspec

gem "rails", :git => "git://github.com/rails/rails.git", :branch => "3-1-stable"
gem "sfl", "~> 2.0"
gem "sprockets"

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
Expand Down
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.

ScssProject::Application.config.session_store :cookie_store, key: '_scss_project_session'
ScssProject::Application.config.session_store :cookie_store, :key => '_scss_project_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
Expand Down
Expand Up @@ -4,7 +4,7 @@
# which will be enabled by default in the upcoming version of Ruby on Rails.

# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActionController::Base.wrap_parameters format: [:json]
ActionController::Base.wrap_parameters :format => [:json]

# Disable root element in JSON by default.
if defined?(ActiveRecord)
Expand Down
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.

ScssProject::Application.config.session_store :cookie_store, key: '_scss_project_session'
ScssProject::Application.config.session_store :cookie_store, :key => '_scss_project_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
Expand Down
Expand Up @@ -4,7 +4,7 @@
# which will be enabled by default in the upcoming version of Ruby on Rails.

# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActionController::Base.wrap_parameters format: [:json]
ActionController::Base.wrap_parameters :format => [:json]

# Disable root element in JSON by default.
if defined?(ActiveRecord)
Expand Down
2 changes: 1 addition & 1 deletion test/sass_rails_logger_test.rb
Expand Up @@ -14,7 +14,7 @@ class SassRailsLoggerTest < Sass::Rails::TestCase
app_root = runcmd 'rails runner "print Rails.root"'

message = "[#{level}]: sass message"
runcmd %{rails runner "Sass::logger.log_level = :#{level}; Sass::logger.log(:#{level}, '#{message}')"}
runcmd %{rails runner "Sass::logger.log_level = :#{level}; Sass::logger.log(:#{level}, %Q|#{message}|)"}

log_output = File.open("#{app_root}/log/development.log").read
assert log_output.include?(message), "the #{level} log message was not found in the log file"
Expand Down
6 changes: 3 additions & 3 deletions test/sass_rails_test.rb
Expand Up @@ -26,14 +26,14 @@ class SassRailsTest < Sass::Rails::TestCase
within_rails_app "scss_project" do
runcmd "rails generate controller foo/bar"
assert_file_exists "app/assets/stylesheets/foo/bar.css.scss"
assert_match File.read("app/assets/stylesheets/foo/bar.css.scss"), /\.foo-bar/
assert_match /\.foo-bar/, File.read("app/assets/stylesheets/foo/bar.css.scss")
end
end
test "sass template has correct dasherized css class for namespaced controllers" do
within_rails_app "sass_project" do
runcmd "rails generate controller foo/bar"
assert_file_exists "app/assets/stylesheets/foo/bar.css.sass"
assert_match File.read("app/assets/stylesheets/foo/bar.css.sass"), /\.foo-bar/
assert_match /\.foo-bar/, File.read("app/assets/stylesheets/foo/bar.css.sass")
end
end
test "templates are registered with sprockets" do
Expand All @@ -42,7 +42,7 @@ class SassRailsTest < Sass::Rails::TestCase
end
test "sprockets require works correctly" do
css_output = sprockets_render("scss_project", "css_application.css")
assert_match css_output, /globbed/
assert_match /globbed/, css_output
end
test "sass imports work correctly" do
css_output = sprockets_render("scss_project", "application.css.scss")
Expand Down
2 changes: 1 addition & 1 deletion test/support/sass_rails_test_case.rb
Expand Up @@ -151,7 +151,7 @@ def runcmd(cmd, working_directory = Dir.pwd, clean_env = true, gemfile = "Gemfil
env["BUNDLE_GEMFILE"] = "#{working_directory}/#{gemfile}" if clean_env
todo = Proc.new do
r, w = IO.pipe
pid = spawn(env, cmd, :out =>w , :err => w, :chdir => working_directory)
pid = Kernel.spawn(env, cmd, :out =>w , :err => w, :chdir => working_directory)
w.close
Process.wait
output = r.read
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Expand Up @@ -4,6 +4,7 @@
require 'rails'
require "rails/test_help"
require 'sass/rails'
require 'sfl'

Rails.backtrace_cleaner.remove_silencers!

Expand Down

0 comments on commit 28a7410

Please sign in to comment.