Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0e14bf382fdd
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b2dc5563b58d
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 31, 2014

  1. Copy the full SHA
    2c8716f View commit details
  2. Merge pull request #676 from davispuh/spec_fix_windows

    Fix sprockets specs for Windows
    meh committed Dec 31, 2014
    Copy the full SHA
    b2dc556 View commit details
Showing with 10 additions and 3 deletions.
  1. +10 −3 spec/lib/sprockets/server_spec.rb
13 changes: 10 additions & 3 deletions spec/lib/sprockets/server_spec.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ def app
s.main = 'opal'
s.debug = false
s.append_path File.expand_path('../../fixtures', __FILE__)
s.sprockets.logger = Logger.new('/dev/null')
s.sprockets.logger = Logger.new(nil)
}
end

@@ -36,7 +36,7 @@ def app

expect(last_response).to be_ok
received_map_path = extract_linked_map(last_response.body)
expect(File.expand_path(received_map_path, js_path+'/..')).to eq(map_path)
expect(expand_path(received_map_path, js_path+'/..')).to eq(map_path)

get '/assets/source_map/subfolder/other_file.map'
expect(last_response).to be_ok
@@ -50,7 +50,7 @@ def app

expect(last_response).to be_ok
received_map_path = extract_linked_map(last_response.body)
expect(File.expand_path(received_map_path, js_path+'/..')).to eq(map_path)
expect(expand_path(received_map_path, js_path+'/..')).to eq(map_path)


get '/assets/source_map/subfolder/other_file.map'
@@ -65,4 +65,11 @@ def extract_linked_map(body)
expect(body).to match(source_map_comment_regexp)
body.scan(source_map_comment_regexp).first.first
end

def expand_path(file_name, dir_string)
path = File.expand_path(file_name, dir_string)
# Remove Windows letter and colon (eg. C:) from path
path = path[2..-1] if !(RUBY_PLATFORM =~ /mswin|mingw/).nil?
path
end
end