Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stringify paths to unique paths correctly #83

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/sassc/rails/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def imports(path, parent_path)
return glob_imports(base, m[2], parent_path)
end

search_paths = ([parent_dir] + load_paths).uniq
# Compass and other gems use their own special loaders
# Hence making this to_s required to have a proper uniq set.
search_paths = ([parent_dir] + load_paths).map(&:to_s).uniq

if specified_dir != "."
search_paths.map! do |path|
Expand Down
2 changes: 2 additions & 0 deletions test/sassc_rails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def initialize!

def initialize_dev!
Rails.env = "development"
Dir.chdir(File.join(File.dirname(__FILE__), '../../../'))
@app.initialize!
end

Expand Down Expand Up @@ -168,6 +169,7 @@ def test_line_comments_active_in_dev
initialize_dev!

css_output = render_asset("css_scss_handler.css")

assert_match %r{/* line 1}, css_output
assert_match %r{.+test/dummy/app/assets/stylesheets/css_scss_handler.css.scss}, css_output
end
Expand Down