Sha256: 913e481501487e18dce11ea6302537ab6bad2520b2bc1cf6fdaa2380192d4759

Contents?: true

Size: 1.11 KB

Versions: 93

Compression:

Stored size: 1.11 KB

Contents

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

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

  describe "#say" do
    it "set the color if specified" do
      out = capture(:stdout) { shell.say "Wow! Now we have colors!", :green }
      out.chomp.should == '<span style="color: green;">Wow! Now we have colors!</span>'
    end

    it "sets bold if specified" do
      out = capture(:stdout) { shell.say "Wow! Now we have colors *and* bold!", [:green, :bold] }
      out.chomp.should == '<span style="color: green; font-weight: bold;">Wow! Now we have colors *and* bold!</span>'
    end

    it "does not use a new line even with colors" do
      out = capture(:stdout) { shell.say "Wow! Now we have colors! ", :green }
      out.chomp.should == '<span style="color: green;">Wow! Now we have colors! </span>'
    end
  end

  describe "#say_status" do
    it "uses color to say status" do
      $stdout.should_receive(:puts).with('<span style="color: red; font-weight: bold;">    conflict</span>  README')
      shell.say_status :conflict, "README", :red
    end
  end

end

Version data entries

93 entries across 78 versions & 13 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
classiccms-0.7.4 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
classiccms-0.7.3 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
classiccms-0.7.2 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
classiccms-0.7.1 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
classiccms-0.7.0 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
challah-1.0.0.beta vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
challah-0.9.1.beta.3 vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
backbone-queryparams-rails-0.0.1 vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
railscast-assets-0.0.2 vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
railscast-assets-0.0.2 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
backbone-forms-on-rails-0.10.0 vendor/bundle/gems/backbone-forms-on-rails-0.10.0/vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
backbone-deep-rails-0.0.1 vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
challah-0.9.1.beta vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/thor-0.16.0/spec/shell/html_spec.rb
challah-0.9.0 vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
classiccms-0.6.9 vendor/bundle/gems/thor-0.15.2/spec/shell/html_spec.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/thor-0.16.0/spec/shell/html_spec.rb