Skip to content

Commit

Permalink
Merge pull request #24 from facto/master
Browse files Browse the repository at this point in the history
Properly scope Rails calls
  • Loading branch information
alexgb committed Mar 30, 2014
2 parents 1ec2fd1 + 9becbee commit 034a15b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/guard/konacha/runner.rb
Expand Up @@ -78,7 +78,7 @@ def konacha_path(path)
end

def real_path(path)
Rails.root.join(::Konacha.config[:spec_dir] + konacha_path(path) + (path[/\.js(\.coffee)?$/] || '')).to_s
::Rails.root.join(::Konacha.config[:spec_dir] + konacha_path(path) + (path[/\.js(\.coffee)?$/] || '')).to_s
end

def unique_id
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/config/application.rb
Expand Up @@ -2,10 +2,10 @@

require 'rails/all'

Bundler.require(:default, Rails.env)
Bundler.require(:default, ::Rails.env)

module Dummy
class Application < Rails::Application
class Application < ::Rails::Application
config.assets.enabled = true
end
end
4 changes: 2 additions & 2 deletions spec/guard/konacha/runner_spec.rb
Expand Up @@ -59,8 +59,8 @@
end

it 'should run each path with a valid extension' do
File.should_receive(:exists?).with(Rails.root.join('spec/javascripts/1.js').to_s).and_return(true)
File.should_receive(:exists?).with(Rails.root.join('spec/javascripts/foo/bar.js.coffee').to_s).and_return(true)
File.should_receive(:exists?).with(::Rails.root.join('spec/javascripts/1.js').to_s).and_return(true)
File.should_receive(:exists?).with(::Rails.root.join('spec/javascripts/foo/bar.js.coffee').to_s).and_return(true)
konacha_runner.should_receive(:run).with('/1')
konacha_runner.should_receive(:run).with('/foo/bar')
runner.run(['spec/javascripts/1.js', 'spec/javascripts/foo/bar.js.coffee'])
Expand Down

0 comments on commit 034a15b

Please sign in to comment.