Sha256: ca1c0f91b27e4585b2c9ecb074ea740f27cd3ae02487a3806522a5ce596644ef

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

#
# Description
#
# Author:: Robert Sharp
# Copyright:: Copyright (c) 2010 Robert Sharp
# License:: Open Software Licence v3.0
#
# This software is licensed for use under the Open Software Licence v. 3.0
# The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
# and in the file copyright.txt. Under the terms of this licence, all derivative works
# must themselves be licensed under the Open Software Licence v. 3.0
# 
# 

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'jerbil/jerbil_service/utils'
require 'jerbil/chuser'


describe "utils" do
  
  it "should classify a string" do
    JerbilService::Utils.classify('robert_sharp').should == "RobertSharp"
    JerbilService::Utils.classify('robert/sharp').should == "Robert::Sharp"
  end
  
  it "should change a user id etc" do
    Process.should_receive(:uid).and_return(0)
    Process::Sys.should_receive(:setuid).once.and_return(true)
    Process::Sys.should_receive(:setgid).once.and_return(true)
    Jerbil::Chuser.change('jermine').should be_true
  end
  
  it "should change a user id for real if run as su" do
    Jerbil::Chuser.change('jermine').should be_true
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jerbil-1.4.8 spec/jservice_utils_spec.rb
jerbil-1.4.7 spec/jservice_utils_spec.rb
jerbil-1.4.6 spec/jservice_utils_spec.rb
jerbil-1.4.5 spec/jservice_utils_spec.rb
jerbil-1.3.3 spec/jservice_utils_spec.rb
jerbil-1.2.2 spec/jservice_utils_spec.rb