Sha256: 52c909e78a30fe3f7ef462d8b62ba63c37ed16d0dede2d32657e36c70c37c883

Contents?: true

Size: 776 Bytes

Versions: 13

Compression:

Stored size: 776 Bytes

Contents

require 'open3'
module FaaStRuby
  module Command
    module Function
      class Test < FunctionBaseCommand
        def initialize(args)
          @args = args
          load_yaml
          @function_name = @yaml_config['name']
          @test_command = @yaml_config['test_command']
        end

        def run(do_not_exit: false)
          unless @test_command
            puts "[skipped] You have no 'test_command' key/value in 'faastruby.yml'. Please consider using rspec!".yellow
            return true
          end
          puts "[test] Running tests"
          system(@test_command)
        end

        def self.help
          'test'.light_cyan
        end

        def usage
          "Usage: faastruby #{self.class.help}"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
faastruby-0.4.18 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.17 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.16 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.15 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.14 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.12 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.11 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.10 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.9 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.8 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.7 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.6 lib/faastruby/cli/commands/function/test.rb
faastruby-0.4.5 lib/faastruby/cli/commands/function/test.rb