Skip to content

Commit

Permalink
fixing some unused variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Mar 21, 2013
1 parent 28a4a1f commit 8badbab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions test/sass/importer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_source_map_with_only_css_uri_supports_public_url_imports
}
SCSS

rendered, sourcemap = engine.render_with_sourcemap('sourcemap_uri')
_, sourcemap = engine.render_with_sourcemap('sourcemap_uri')
assert_equal <<JSON.strip, sourcemap.to_json(:css_uri => 'css_uri')
{
"version": "3",
Expand All @@ -223,7 +223,7 @@ def test_source_map_with_only_css_uri_doesnt_support_filesystem_importer
.foo {a: b}
SCSS

rendered, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')
_, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')

assert_warning(<<WARNING) {sourcemap.to_json(:css_uri => 'css_uri')}
WARNING: Couldn't determine public URL for "#{filename_for_test(:scss)}" while generating sourcemap.
Expand All @@ -244,7 +244,7 @@ def test_source_map_with_css_uri_and_css_path_doesnt_support_filesystem_importer
.foo {a: b}
SCSS

rendered, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')
_, sourcemap = engine.render_with_sourcemap('http://1.example.com/style.map')

assert_warning(<<WARNING) {sourcemap.to_json(:css_uri => 'css_uri', :css_path => 'css_path')}
WARNING: Couldn't determine public URL for "#{filename_for_test(:scss)}" while generating sourcemap.
Expand Down Expand Up @@ -293,7 +293,7 @@ def test_source_map_with_css_path_and_sourcemap_path_supports_file_system_import
.foo {a: b}
SCSS

rendered, sourcemap = engine.render_with_sourcemap('http://map.example.com/map/style.map')
_, sourcemap = engine.render_with_sourcemap('http://map.example.com/map/style.map')
css_path = 'static/style.css'
sourcemap_path = 'map/style.map'
assert_equal <<JSON.strip, sourcemap.to_json(:css_path => css_path, :sourcemap_path => sourcemap_path)
Expand Down
5 changes: 2 additions & 3 deletions test/sass/source_map_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def test_while_sourcemap_scss
CSS
end

def test_while_sourcemap_sass
def test_while_sourcemap_sass
assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass
$i: 6
@while $i > 0
Expand Down Expand Up @@ -723,7 +723,6 @@ def build_ranges(text, file_name = nil)
start_positions = {}
text.split("\n").each_with_index do |line_text, line|
line += 1 # lines shoud be 1-based
match_start = 0
while match = line_text.match(ANNOTATION_REGEX)
closing = !match[1].empty?
name = match[2]
Expand All @@ -750,7 +749,7 @@ def build_mapping_from_annotations(source, css, source_file_name)
source_ranges = build_ranges(source, source_file_name)
target_ranges = build_ranges(css)
map = Sass::Source::Map.new
mappings = Sass::Util.flatten(source_ranges.map do |(name, sources)|
Sass::Util.flatten(source_ranges.map do |(name, sources)|
assert(sources.length == 1, "#{sources.length} source ranges encountered for annotation #{name}")
assert(target_ranges[name], "No target ranges for annotation #{name}")
target_ranges[name].map {|target_range| [sources.first, target_range]}
Expand Down

0 comments on commit 8badbab

Please sign in to comment.