Class: MarkdownExec::TestHashDelegator::TestHashDelegatorFormatExecutionStreams

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/hash_delegator.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



2900
2901
2902
2903
# File 'lib/hash_delegator.rb', line 2900

def setup
  @hd = HashDelegator.new
  @hd.instance_variable_set(:@run_state, mock('run_state'))
end

#test_format_execution_streams_with_empty_keyObject



2912
2913
2914
2915
2916
2917
2918
# File 'lib/hash_delegator.rb', line 2912

def test_format_execution_streams_with_empty_key
  @hd.instance_variable_get(:@run_state).stubs(:files).returns({})

  result = HashDelegator.format_execution_streams(:stderr)

  assert_equal '', result
end

#test_format_execution_streams_with_nil_filesObject



2920
2921
2922
2923
2924
2925
2926
# File 'lib/hash_delegator.rb', line 2920

def test_format_execution_streams_with_nil_files
  @hd.instance_variable_get(:@run_state).stubs(:files).returns(nil)

  result = HashDelegator.format_execution_streams(:stdin)

  assert_equal '', result
end

#test_format_execution_streams_with_valid_keyObject



2905
2906
2907
2908
2909
2910
# File 'lib/hash_delegator.rb', line 2905

def test_format_execution_streams_with_valid_key
  result = HashDelegator.format_execution_streams(:stdout,
                                                  { stdout: %w[output1 output2] })

  assert_equal 'output1output2', result
end