Sha256: 00396c8dfe21f0ba5d9224b71e756ed6d314eb0a0931f9aeb64bf43aca140b8d

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

require_relative 'habitat-studio'

module Context
  class ContextCucumberStudio < DefaultStudio
    banner "knife context cucumber studio"

    deps do
      Knife::DefaultKnifeContext.load_deps
    end

    def run
      case name_args[1]
      when 'destroy'
        execute_command(%w(knife context cookbook studio destroy)) if name_args[0] == 'kitchen'
      when 'enter'
        execute_command(%w(knife context habitat studio enter)) if name_args[0] == 'habitat'
      when 'build'
        execute_command(%w(knife context habitat studio build) + name_args) if name_args[0] == 'habitat'
      else
        if name_args[0]
          additionnal_tag = name_args[1].nil? ? [] : ['--tags', "@#{name_args[1]}"]
          case name_args[0]
          when 'cycle'
            cucumber(self, ['--profile', 'initialize'] + additionnal_tag)
            cucumber(self, ['--profile', 'planning'] + additionnal_tag)
            cucumber(self, ['--profile', 'execution'] + additionnal_tag)
            cucumber(self, ['--profile', 'closure'] + additionnal_tag)
          else
            cucumber(self, ['--profile', name_args[0]] + additionnal_tag)
          end
        end
      end
    end

    def studio_available?
      is_binary_available?('cucumber') && super
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deploy-context-2.13.8 /src/libraries/deploy-context/helpers/../../../libraries/deploy-context/cucumber-studio.rb