Skip to content

Commit

Permalink
Spec added
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGorbanev committed Jan 10, 2017
1 parent 84c555d commit 2085aa2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/generators/react_on_rails/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def installation_prerequisites_met?

def missing_npm?
return false unless
running_on_windows? ? `where npm`.blank? : `which npm`.blank?
ReactOnRails::Utils.running_on_windows? ? `where npm`.blank? : `which npm`.blank?
error = "npm is required. Please install it before continuing. "
error << "https://www.npmjs.com/"
GeneratorMessages.add_error(error)
Expand All @@ -74,7 +74,7 @@ def missing_npm?

def missing_node?
return false unless
running_on_windows? ? `where node`.blank? : `which node`.blank?
ReactOnRails::Utils.running_on_windows? ? `where node`.blank? : `which node`.blank?
error = "** nodejs is required. Please install it before continuing. "
error << "https://nodejs.org/en/"
GeneratorMessages.add_error(error)
Expand Down
11 changes: 11 additions & 0 deletions spec/react_on_rails/utils_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require_relative "spec_helper"
require_relative "../../lib/react_on_rails/utils"

describe ReactOnRails::Utils do
it "detect running OS" do
%w(cygwin mswin mingw bccwin wince emx).each do |platform|
RUBY_PLATFORM = platform
ReactOnRails::Utils.running_on_windows?.should == true
end
end
end

0 comments on commit 2085aa2

Please sign in to comment.