Sha256: b859059765655e52cf7c61e7d230c7d88d47ead3705e8c17395c9f96228f5db7

Contents?: true

Size: 793 Bytes

Versions: 34

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

describe Commander::UI do
  include Commander::Methods

  describe '.replace_tokens' do
    it 'should replace tokens within a string, with hash values' do
      result = Commander::UI.replace_tokens 'Welcome :name, enjoy your :object'.freeze, name: 'TJ', object: 'cookie'
      expect(result).to eq('Welcome TJ, enjoy your cookie')
    end
  end

  describe 'progress' do
    it 'should not die on an empty list' do
      exception = false
      begin
        progress([]) {}
      rescue
        exception = true
      end
      expect(exception).not_to be true
    end
  end

  describe '.available_editor' do
    it 'should not fail on available editors with shell arguments' do
      expect(Commander::UI.available_editor('sh -c')).to eq('sh -c')
    end
  end
end

Version data entries

34 entries across 34 versions & 5 rubygems

Version Path
commander-openflighthpc-2.0.2 spec/ui_spec.rb
commander-openflighthpc-2.0.1 spec/ui_spec.rb
commander-openflighthpc-2.0.0 spec/ui_spec.rb
commander-4.5.2 spec/ui_spec.rb
commander-4.5.1 spec/ui_spec.rb
commander-4.5.0 spec/ui_spec.rb
commander-openflighthpc-1.2.0 spec/ui_spec.rb
commander-openflighthpc-1.1.2 spec/ui_spec.rb
commander-openflighthpc-1.1.1 spec/ui_spec.rb
commander-openflighthpc-1.1.0 spec/ui_spec.rb
commander-openflighthpc-1.0.0 spec/ui_spec.rb
commander-openflighthpc-1.0.0.pre.alpha1 spec/ui_spec.rb
commander-4.4.7 spec/ui_spec.rb
murano-cli-commander-4.4.10 spec/ui_spec.rb
commander-4.4.6 spec/ui_spec.rb
commander-4.4.5 spec/ui_spec.rb
commander-fastlane-4.4.6 spec/ui_spec.rb
commander-4.4.4 spec/ui_spec.rb
commander-fastlane-4.4.5 spec/ui_spec.rb
commander-fastlane-4.4.4 spec/ui_spec.rb