Sha256: 12e92ce4a930b1e47e58fe811352493906641aec557e9620df6f96f7f3eef470

Contents?: true

Size: 951 Bytes

Versions: 64

Compression:

Stored size: 951 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "test_helper")
require 'mocha/pretty_parameters'

class PrettyParametersTest < Test::Unit::TestCase
  
  include Mocha

  def test_should_remove_outer_array_braces
    params = [1, 2, [3, 4]]
    parameters = PrettyParameters.new(params)
    assert_equal '1, 2, [3, 4]', parameters.pretty
  end
  
  def test_should_display_numeric_arguments_as_is
    params = [1, 2, 3]
    parameters = PrettyParameters.new(params)
    assert_equal '1, 2, 3', parameters.pretty
  end
  
  def test_should_remove_curly_braces_if_hash_is_only_argument
    params = [{:a => 1, :z => 2}]
    parameters = PrettyParameters.new(params)
    assert_match /^:[az] => [12], :[az] => [12]$/, parameters.pretty
  end
  
  def test_should_not_remove_curly_braces_if_hash_is_not_the_only_argument
    params = [1, {:a => 1}]
    parameters = PrettyParameters.new(params)
    assert_equal '1, {:a => 1}', parameters.pretty
  end

end

Version data entries

64 entries across 64 versions & 5 rubygems

Version Path
greatseth-google-geo-2.0 vendor/mocha-0.4.0/test/mocha/pretty_parameters_test.rb
greatseth-google-geo-2.1 vendor/mocha-0.4.0/test/mocha/pretty_parameters_test.rb
greatseth-google-geo-2.2 vendor/mocha-0.4.0/test/mocha/pretty_parameters_test.rb
redcar-dev-0.12.1dev-java lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-dev-0.12.0dev-java lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.11 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.11.0dev lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.10 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.9.2 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.9.1 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.9.0 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.8.1 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.8 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.7 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.6.1 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.6 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.6.1dev lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.5.1 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.5 lib/openssl/mocha/test/unit/pretty_parameters_test.rb
redcar-0.5.6dev lib/openssl/mocha/test/unit/pretty_parameters_test.rb