Sha256: 8a6d054687d996d8b53f453ca4ea62ba60fc94f23c4f2c60285b39b33d626c8b

Contents?: true

Size: 876 Bytes

Versions: 8

Compression:

Stored size: 876 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Thor::Shell do
  def shell
    @shell ||= Thor::Base.shell.new
  end

  describe "#initialize" do
    it "sets shell value" do
      base = MyCounter.new [1, 2], { }, :shell => shell
      base.shell.must == shell
    end

    it "sets the base value on the shell if an accessor is available" do
      base = MyCounter.new [1, 2], { }, :shell => shell
      shell.base.must == base
    end
  end

  describe "#shell" do
    it "returns the shell in use" do
      MyCounter.new([1,2]).shell.must be_kind_of(Thor::Base.shell)
    end
  end

  describe "with_padding" do
    it "uses padding for inside block outputs" do
      base = MyCounter.new([1,2])
      base.with_padding do
        capture(:stdout){ base.say_status :padding, "cool" }.strip.must == "padding    cool"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
puppet-module-0.3.4 vendor/thor-852190ae/spec/shell_spec.rb
puppet-module-0.3.3 vendor/thor-852190ae/spec/shell_spec.rb
puppet-module-0.3.2 vendor/thor-852190ae/spec/shell_spec.rb
angry_mob-0.1.0 vendor/thor/spec/shell_spec.rb
puppet-module-0.3.0 vendor/thor-852190ae/spec/shell_spec.rb
thor-0.13.6 spec/shell_spec.rb
thor-0.13.5 spec/shell_spec.rb
thor-0.13.4 spec/shell_spec.rb