Sha256: 478146ea92376fa5bab5484a3ffcd8366e07a3903f27868b7c59917fbf310f24

Contents?: true

Size: 763 Bytes

Versions: 8

Compression:

Stored size: 763 Bytes

Contents

require 'spec_helper'

describe Commander::UI do
  
  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'
      result.should 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
      exception.should_not be_true
    end
  end
  
  describe ".available_editor" do
    it "should not fail on available editors with shell arguments" do
      Commander::UI.available_editor('sh -c').should eq('sh -c')
    end
  end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
clone-1.0.0.beta2 module/gems/commander-4.1.3/spec/ui_spec.rb
clone-1.0.0.beta module/gems/commander-4.1.3/spec/ui_spec.rb
commander-4.1.6 spec/ui_spec.rb
commander-4.1.5 spec/ui_spec.rb
commander-4.1.4 spec/ui_spec.rb
commander-4.1.3 spec/ui_spec.rb
commander-4.1.2 spec/ui_spec.rb
commander-4.1.1 spec/ui_spec.rb