Sha256: 6befb59d2731eea59906863ab5278c733cecee485307e029d35e93513594a514

Contents?: true

Size: 1.18 KB

Versions: 23

Compression:

Stored size: 1.18 KB

Contents

require File.join(File.dirname(__FILE__),'spec_helper')

describe "Node" do
  include Rhoconnect
  include TestHelpers

  before(:each) do
    Store.create
    Store.flush_all
    Rhoconnect.use_node = true
  end

  after(:each) do
    Rhoconnect::Node.kill_process
  end

  it "should start node" do
    Rhoconnect.bootstrap(get_testapp_path)
    Rhoconnect::Node.started.should == true
  end

  it "should stop node" do
    Rhoconnect.bootstrap(get_testapp_path)
    Rhoconnect::Node.started.should == true
    Rhoconnect::Node.kill_process
    Rhoconnect::Node.started.should == false
  end

  it "should print message if `package.json` not detected" do
    File.stub(:exists?).and_return(false)
    Rhoconnect::Node.should_receive(:log).once.with("No `package.json` detected, disabling JavaScript support.")
    Rhoconnect.bootstrap(get_testapp_path)
    Rhoconnect::Node.started.should == false
  end

  it "should print message if node not detected" do
    File.stub(:executable?).and_return(false)
    Rhoconnect::Node.should_receive(:log).once.with("Node.js not detected, disabling JavaScript support.")
    Rhoconnect.bootstrap(get_testapp_path)
    Rhoconnect::Node.started.should == false
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 spec/node_spec.rb
rhoconnect-7.5.1 spec/node_spec.rb
rhoconnect-7.4.1 spec/node_spec.rb
rhoconnect-7.1.17 spec/node_spec.rb
rhoconnect-6.2.0 spec/node_spec.rb
rhoconnect-6.0.11 spec/node_spec.rb
rhoconnect-5.5.18 spec/node_spec.rb
rhoconnect-5.5.17 spec/node_spec.rb
rhoconnect-5.5.15 spec/node_spec.rb
rhoconnect-5.5.0.22 spec/node_spec.rb
rhoconnect-5.5.2 spec/node_spec.rb
rhoconnect-5.5.0.7 spec/node_spec.rb
rhoconnect-5.5.0.3 spec/node_spec.rb
rhoconnect-5.5.0 spec/node_spec.rb
rhoconnect-5.1.1 spec/node_spec.rb
rhoconnect-4.0.4 spec/node_spec.rb
rhoconnect-4.0.3 spec/node_spec.rb
rhoconnect-4.0.2 spec/node_spec.rb
rhoconnect-4.0.1 spec/node_spec.rb
rhoconnect-4.0.0 spec/node_spec.rb