diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-08-07 10:54:08 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-08-07 10:54:08 -0700 |
commit | d498b5e6baeda404b6d00909c5ae4302cd39783a (patch) | |
tree | c5047bbcbef53e5d8235973951f72a10654c8768 /railties/test/application/assets_test.rb | |
parent | 185d74cf383520622cee6fa7a520d7ff8151f6b3 (diff) | |
download | rails-d498b5e6baeda404b6d00909c5ae4302cd39783a.tar.gz rails-d498b5e6baeda404b6d00909c5ae4302cd39783a.tar.bz2 rails-d498b5e6baeda404b6d00909c5ae4302cd39783a.zip |
make assertions easier to track down
Diffstat (limited to 'railties/test/application/assets_test.rb')
-rw-r--r-- | railties/test/application/assets_test.rb | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index ba32e4904f..33a6800e14 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -94,20 +94,28 @@ module ApplicationTests precompile! images_should_compile.each do |filename| - assert File.exists?("#{app_path}/public/assets/#{filename}") + assert_file_exists "#{app_path}/public/assets/#{filename}" end - assert File.exists?("#{app_path}/public/assets/application.js") - assert File.exists?("#{app_path}/public/assets/application.css") + assert_file_exists("#{app_path}/public/assets/application.js") + assert_file_exists("#{app_path}/public/assets/application.css") + + assert_no_file_exists("#{app_path}/public/assets/someapplication.js") + assert_no_file_exists("#{app_path}/public/assets/someapplication.css") - assert !File.exists?("#{app_path}/public/assets/someapplication.js") - assert !File.exists?("#{app_path}/public/assets/someapplication.css") + assert_no_file_exists("#{app_path}/public/assets/something.min.js") + assert_no_file_exists("#{app_path}/public/assets/something.min.css") - assert !File.exists?("#{app_path}/public/assets/something.min.js") - assert !File.exists?("#{app_path}/public/assets/something.min.css") + assert_no_file_exists("#{app_path}/public/assets/something.else.js") + assert_no_file_exists("#{app_path}/public/assets/something.else.css") + end + + def assert_file_exists(filename) + assert File.exists?(filename), "missing #{filename}" + end - assert !File.exists?("#{app_path}/public/assets/something.else.js") - assert !File.exists?("#{app_path}/public/assets/something.else.css") + def assert_no_file_exists(filename) + assert !File.exists?(filename), "#{filename} does exist" end test "precompile something.js for directory containing index file" do |