Sha256: b9d8443be69d0f123e3f0c7c7df2d0193a7a129d3d5208be2ac84e0b0d1afdad

Contents?: true

Size: 1.1 KB

Versions: 17

Compression:

Stored size: 1.1 KB

Contents

require 'helper'

require "spring/client/command"
require 'spring/client/help'
require 'spring/client'

class HelpTest < ActiveSupport::TestCase
  def spring_commands
    {
      'command' => Class.new {
        def self.description
          'Random Spring Command'
        end
      },
      'rails' => Class.new {
        def self.description
          "omg"
        end
      }
    }
  end

  def application_commands
    {
      'random' => Class.new {
        def description
          'Random Application Command'
        end
      }.new,
      'hidden' => Class.new {
        def description
          nil
        end
      }.new
    }
  end

  def setup
    @help = Spring::Client::Help.new('help', spring_commands, application_commands)
  end

  test "formatted_help generates expected output" do
    expected_output = <<-EOF
Version: #{Spring::VERSION}

Usage: spring COMMAND [ARGS]

Commands for spring itself:

  command  Random Spring Command

Commands for your application:

  rails    omg
  random   Random Application Command
    EOF

    assert_equal expected_output.chomp, @help.formatted_help
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spring-1.3.3 test/unit/client/help_test.rb
spring-1.3.2 test/unit/client/help_test.rb
spring-1.3.1 test/unit/client/help_test.rb
spring-1.3.0 test/unit/client/help_test.rb
spring-1.2.0 test/unit/client/help_test.rb
spring-1.1.3 test/unit/client/help_test.rb
spring-1.1.2 test/unit/client/help_test.rb
spring-1.1.1 test/unit/client/help_test.rb
spring-1.1.0 test/unit/client/help_test.rb
spring-1.1.0.beta4 test/unit/client/help_test.rb
spring-1.1.0.beta3 test/unit/client/help_test.rb
spring-1.1.0.beta2 test/unit/client/help_test.rb
spring-1.1.0.beta1 test/unit/client/help_test.rb
spring-1.0.0 test/unit/client/help_test.rb
spring-0.9.2 test/unit/client/help_test.rb
spring-0.9.1 test/unit/client/help_test.rb
spring-0.9.0 test/unit/client/help_test.rb