diff options
-rw-r--r-- | actioncable/CHANGELOG.md | 5 | ||||
-rw-r--r-- | actioncable/lib/rails/generators/channel/channel_generator.rb | 4 | ||||
-rw-r--r-- | actionmailer/CHANGELOG.md | 3 | ||||
-rw-r--r-- | actionpack/CHANGELOG.md | 3 | ||||
-rw-r--r-- | actionview/CHANGELOG.md | 3 | ||||
-rw-r--r-- | activejob/CHANGELOG.md | 3 | ||||
-rw-r--r-- | activemodel/CHANGELOG.md | 3 | ||||
-rw-r--r-- | activerecord/CHANGELOG.md | 3 | ||||
-rw-r--r-- | activesupport/CHANGELOG.md | 3 | ||||
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 9 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/attribute_accessors.rb | 12 | ||||
-rw-r--r-- | guides/source/command_line.md | 6 | ||||
-rw-r--r-- | railties/lib/rails/test_unit/reporter.rb | 8 | ||||
-rw-r--r-- | railties/test/application/test_runner_test.rb | 3 | ||||
-rw-r--r-- | railties/test/generators/channel_generator_test.rb | 30 | ||||
-rw-r--r-- | railties/test/generators/plugin_test_runner_test.rb | 3 | ||||
-rw-r--r-- | railties/test/generators/test_runner_in_engine_test.rb | 3 | ||||
-rw-r--r-- | railties/test/test_unit/reporter_test.rb | 9 |
18 files changed, 67 insertions, 46 deletions
diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md index 64aea88588..22126d82b7 100644 --- a/actioncable/CHANGELOG.md +++ b/actioncable/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * Added to Rails! - *DHH*
\ No newline at end of file + *DHH* diff --git a/actioncable/lib/rails/generators/channel/channel_generator.rb b/actioncable/lib/rails/generators/channel/channel_generator.rb index 2f37d8055b..925dd3d098 100644 --- a/actioncable/lib/rails/generators/channel/channel_generator.rb +++ b/actioncable/lib/rails/generators/channel/channel_generator.rb @@ -9,7 +9,9 @@ module Rails def create_channel_file template "channel.rb", File.join('app/channels', class_path, "#{file_name}_channel.rb") - template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee") + if Rails::Generators.options[:rails][:assets] + template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee") + end end protected diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index 73ce989a5a..0cab1b8672 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * `config.force_ssl = true` will set `config.action_mailer.default_url_options = { protocol: 'https' }` diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 3314a0b77d..533436a0c2 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * Deprecate `redirect_to :back` in favor of `redirect_back`, which accepts a required `fallback_location` argument, thus eliminating the possibility of a `RedirectBackError`. diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index e26e7337e4..d4cdde4c0a 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * `I18n.translate` helper will wrap the missing translation keys in a <span> tag only if `debug_missing_translation` configuration be true. Default value is `true`. For example in `application.rb`: diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index 2caa073f68..c4c49af53a 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * Fixed serializing `:at` option for `assert_enqueued_with` and `assert_performed_with`. diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index 19143d63ac..e4769d2f40 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * Validate multiple contexts on `valid?` and `invalid?` at once. Example: diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 9819b85205..fb6c5e7e81 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * Order the result of `find(ids)` to match the passed array, if the relation has no explicit order defined. diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 2656d3f113..1f459a843d 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,8 +1,5 @@ ## Rails 5.0.0.beta1 (December 18, 2015) ## -* No changes. - - * Add thread_m/cattr_accessor/reader/writer suite of methods for declaring class and module variables that live per-thread. This makes it easy to declare per-thread globals that are encapsulated. Note: This is a sharp edge. A wild proliferation of globals is A Bad Thing. But like other sharp tools, when it's right, it's right. diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 8272d3395c..610105f41c 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -255,10 +255,11 @@ module ActiveSupport # end # end # - # # val_1 => "new value 1" - # # val_2 => "original value" - # # sleep 10 # First thread extend the life of cache by another 10 seconds - # # cache.fetch('foo') => "new value 1" + # cache.fetch('foo') # => "original value" + # sleep 10 # First thread extended the life of cache by another 10 seconds + # cache.fetch('foo') # => "new value 1" + # val_1 # => "new value 1" + # val_2 # => "original value" # # Other options will be handled by the specific cache store implementation. # Internally, #fetch calls #read_entry, and calls #write_entry on a cache diff --git a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb index 124f90dc0f..76825862d7 100644 --- a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +++ b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb @@ -49,7 +49,7 @@ class Module # include HairColors # end # - # Person.hair_colors # => [:brown, :black, :blonde, :red] + # Person.new.hair_colors # => [:brown, :black, :blonde, :red] def mattr_reader(*syms) options = syms.extract_options! syms.each do |sym| @@ -105,7 +105,7 @@ class Module # # Also, you can pass a block to set up the attribute with a default value. # - # class HairColors + # module HairColors # mattr_writer :hair_colors do # [:brown, :black, :blonde, :red] # end @@ -150,8 +150,8 @@ class Module # include HairColors # end # - # Person.hair_colors = [:brown, :black, :blonde, :red] - # Person.hair_colors # => [:brown, :black, :blonde, :red] + # HairColors.hair_colors = [:brown, :black, :blonde, :red] + # HairColors.hair_colors # => [:brown, :black, :blonde, :red] # Person.new.hair_colors # => [:brown, :black, :blonde, :red] # # If a subclass changes the value then that would also change the value for @@ -161,8 +161,8 @@ class Module # class Male < Person # end # - # Male.hair_colors << :blue - # Person.hair_colors # => [:brown, :black, :blonde, :red, :blue] + # Male.new.hair_colors << :blue + # Person.new.hair_colors # => [:brown, :black, :blonde, :red, :blue] # # To opt out of the instance writer method, pass <tt>instance_writer: false</tt>. # To opt out of the instance reader method, pass <tt>instance_reader: false</tt>. diff --git a/guides/source/command_line.md b/guides/source/command_line.md index e85f9fc9c6..eb9bf3fa18 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -39,7 +39,7 @@ INFO: You can install the rails gem by typing `gem install rails`, if you don't ```bash $ rails new commandsapp create - create README.rdoc + create README.md create Rakefile create config.ru create .gitignore @@ -584,8 +584,8 @@ $ rails new . --git --database=postgresql create tmp/pids create Rakefile add 'Rakefile' - create README.rdoc -add 'README.rdoc' + create README.md +add 'README.md' create app/controllers/application_controller.rb add 'app/controllers/application_controller.rb' create app/helpers/application_helper.rb diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb index 00ea32d1b8..695c67756b 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -12,7 +12,7 @@ module Rails if output_inline? && result.failure && (!result.skipped? || options[:verbose]) io.puts io.puts - io.puts result.failures.map(&:message) + io.puts format_failures(result) io.puts io.puts format_rerun_snippet(result) io.puts @@ -56,6 +56,12 @@ module Rails options[:fail_fast] end + def format_failures(result) + result.failures.map do |failure| + "#{failure.result_label}:\n#{result.class}##{result.name}:\n#{failure.message}\n" + end + end + def format_rerun_snippet(result) # Try to extract path to assertion from backtrace. if result.location =~ /\[(.*)\]\z/ diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 4965ab7da0..92a9b99fd8 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -344,7 +344,8 @@ module ApplicationTests create_test_file :models, 'post', pass: false output = run_test_command('test/models/post_test.rb') - assert_match %r{Running:\n\nPostTest\nF\n\nwups!\n\nbin/rails test test/models/post_test.rb:6}, output + expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth:\nwups!\n\nbin/rails test test/models/post_test.rb:6\n\n\n\n} + assert_match expect, output end def test_only_inline_failure_output diff --git a/railties/test/generators/channel_generator_test.rb b/railties/test/generators/channel_generator_test.rb new file mode 100644 index 0000000000..5cc1cd83b1 --- /dev/null +++ b/railties/test/generators/channel_generator_test.rb @@ -0,0 +1,30 @@ +require 'generators/generators_test_helper' +require 'rails/generators/channel/channel_generator' + +class ChannelGeneratorTest < Rails::Generators::TestCase + include GeneratorsTestHelper + tests Rails::Generators::ChannelGenerator + + def test_channel_is_created + run_generator ['chat'] + + assert_file "app/channels/chat_channel.rb" do |channel| + assert_match(/class ChatChannel < ApplicationCable::Channel/, channel) + end + + assert_file "app/assets/javascripts/channels/chat.coffee" do |channel| + assert_match(/App.cable.subscriptions.create "ChatChannel"/, channel) + end + end + + def test_channel_asset_is_not_created + Rails::Generators.options[:rails][:assets] = false + run_generator ['chat'] + + assert_file "app/channels/chat_channel.rb" do |channel| + assert_match(/class ChatChannel < ApplicationCable::Channel/, channel) + end + + assert_no_file "app/assets/javascripts/channels/chat.coffee" + end +end diff --git a/railties/test/generators/plugin_test_runner_test.rb b/railties/test/generators/plugin_test_runner_test.rb index 716728819e..f0fb63c208 100644 --- a/railties/test/generators/plugin_test_runner_test.rb +++ b/railties/test/generators/plugin_test_runner_test.rb @@ -71,7 +71,8 @@ class PluginTestRunnerTest < ActiveSupport::TestCase create_test_file 'post', pass: false output = run_test_command('test/post_test.rb') - assert_match %r{Running:\n\nPostTest\nF\n\nwups!\n\nbin/test (/private)?#{plugin_path}/test/post_test.rb:6}, output + expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth:\nwups!\n\nbin/test (/private)?#{plugin_path}/test/post_test.rb:6} + assert_match expect, output end def test_only_inline_failure_output diff --git a/railties/test/generators/test_runner_in_engine_test.rb b/railties/test/generators/test_runner_in_engine_test.rb index 641c5d0835..69906b962b 100644 --- a/railties/test/generators/test_runner_in_engine_test.rb +++ b/railties/test/generators/test_runner_in_engine_test.rb @@ -17,7 +17,8 @@ class TestRunnerInEngineTest < ActiveSupport::TestCase create_test_file 'post', pass: false output = run_test_command('test/post_test.rb') - assert_match %r{Running:\n\nPostTest\nF\n\nwups!\n\nbin/rails test test/post_test.rb:6}, output + expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth:\nwups!\n\nbin/rails test test/post_test.rb:6} + assert_match expect, output end private diff --git a/railties/test/test_unit/reporter_test.rb b/railties/test/test_unit/reporter_test.rb index e517d8dd0b..3ff7cd18cd 100644 --- a/railties/test/test_unit/reporter_test.rb +++ b/railties/test/test_unit/reporter_test.rb @@ -61,14 +61,16 @@ class TestUnitReporterTest < ActiveSupport::TestCase @reporter.record(failed_test) @reporter.report - assert_match %r{\A\n\nboo\n\nbin/rails test .*test/test_unit/reporter_test.rb:\d+\n\n\z}, @output.string + expect = %r{\A\n\nFailure:\nTestUnitReporterTest::ExampleTest#woot:\nboo\n\nbin/rails test test/test_unit/reporter_test.rb:\d+\n\n\z} + assert_match expect, @output.string end test "outputs errors inline" do @reporter.record(errored_test) @reporter.report - assert_match %r{\A\n\nArgumentError: wups\n No backtrace\n\nbin/rails test .*test/test_unit/reporter_test.rb:6\n\n\z}, @output.string + expect = %r{\A\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n No backtrace\n\nbin/rails test .*test/test_unit/reporter_test.rb:6\n\n\z} + assert_match expect, @output.string end test "outputs skipped tests inline if verbose" do @@ -76,7 +78,8 @@ class TestUnitReporterTest < ActiveSupport::TestCase verbose.record(skipped_test) verbose.report - assert_match %r{\A\n\nskipchurches, misstemples\n\nbin/rails test .*test/test_unit/reporter_test.rb:\d+\n\n\z}, @output.string + expect = %r{\A\n\nSkipped:\nTestUnitReporterTest::ExampleTest#woot:\nskipchurches, misstemples\n\nbin/rails test test/test_unit/reporter_test.rb:\d+\n\n\z} + assert_match expect, @output.string end test "does not output rerun snippets after run" do |