lib/wire/commands/spec_command.rb
# process specification for whole project model
process specification for whole project model
process specification for whole project model
def run_on_project
      @target_dir = @params[:target_dir]
      zones = @project.get_element('zones')
      run_on_project_zones(zones)
      target_specdir = File.join(@target_dir, 'serverspec')
      begin
        spec_writer = SpecWriter.new(target_specdir, @spec_code)
        spec_writer.write
        outputs 'SPEC', "Serverspecs written to #{target_specdir}. Run:"
        outputs 'SPEC', "( cd #{target_specdir}; sudo rake spec )"
        outputs 'SPEC', 'To run automatically, use --run'
      rescue => exception
        $log.error "Error writing serverspec files, #{exception}"
        STDERR.puts exception.inspect
      end
      run_serverspec(target_specdir) if @params[:auto_run]
    end
def run_on_project @target_dir = @params [ :target_dir ] zones = @project . get_element ( 'zones' ) run_on_project_zones ( zones ) target_specdir = File . join ( @target_dir , 'serverspec' ) begin spec_writer = SpecWriter . new ( target_specdir , @spec_code ) spec_writer . write outputs 'SPEC' , "Serverspecs written to #{target_specdir}. Run:" outputs 'SPEC' , "( cd #{target_specdir}; sudo rake spec )" outputs 'SPEC' , 'To run automatically, use --run' rescue => exception $log . error "Error writing serverspec files, #{exception}" STDERR . puts exception . inspect end run_serverspec ( target_specdir ) if @params [ :auto_run ] end
process specification for whole project model
process specification for whole project model
# iterates all zones, descend into zone # use the specwrite class to write a complete # serverspec example in a subdirectory(serverspec)