Skip to content

Commit

Permalink
Fixed missing space bug introduces in rails/rails@9299bfd.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Lindqvist committed Mar 22, 2012
1 parent 6424922 commit c5f4b20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion railties/lib/rails/source_annotation_extractor.rb
Expand Up @@ -22,7 +22,7 @@ class Annotation < Struct.new(:line, :tag, :text)
# If +options+ has a flag <tt>:tag</tt> the tag is shown as in the example above.
# Otherwise the string contains just line and text.
def to_s(options={})
s = "[#{line.to_s.rjust(options[:indent])}]"
s = "[#{line.to_s.rjust(options[:indent])}] "
s << "[#{tag}] " if options[:tag]
s << text
end
Expand Down
7 changes: 4 additions & 3 deletions railties/test/application/rake/notes_test.rb
Expand Up @@ -28,7 +28,7 @@ def teardown

Dir.chdir(app_path) do
output = `bundle exec rake notes`
lines = output.scan(/\[([0-9\s]+)\]/).flatten
lines = output.scan(/\[([0-9\s]+)\](\s)/)

assert_match /note in erb/, output
assert_match /note in haml/, output
Expand All @@ -38,8 +38,9 @@ def teardown

assert_equal 5, lines.size

lines.each do |line_number|
assert_equal 4, line_number.size
lines.each do |line|
assert_equal 4, line[0].size
assert_equal ' ', line[1]
end
end

Expand Down

0 comments on commit c5f4b20

Please sign in to comment.