Sha256: 79bf666f69b41e7382a5ca8a3e093b2b269b85c80704c2b6d7906910bdca5111

Contents?: true

Size: 1.25 KB

Versions: 44

Compression:

Stored size: 1.25 KB

Contents

require 'test_plugin_helper'

class RemoteExecutionHelperTest < ActionView::TestCase
  describe '#normalize_line_sets' do
    let :line_sets do
      [{"output_type"=>"stdout", "output"=>"one", "timestamp"=>1},
       {"output_type"=>"stdout", "output"=>"\r\ntwo\r\n", "timestamp"=>2},
       {"output_type"=>"stdout", "output"=>"\r\nthr", "timestamp"=>3},
       {"output_type"=>"stdout", "output"=>"ee\r\nfour\r\n", "timestamp"=>4},
       {"output_type"=>"stdout", "output"=>"\r\n\r\n", "timestamp"=>5},
       {"output_type"=>"stdout", "output"=>"five\r\n", "timestamp"=>6},
       {"output_type"=>"stdout", "output"=>"Exit status: 0", "timestamp"=>7}]
    end

    it 'ensures the line sets end with new line' do
      new_line_sets = normalize_line_sets(line_sets)
      new_line_sets.map { |s| s['output'] }.must_equal(["one\r\n",
                                                        "two\r\n",
                                                        "\r\nthree\r\n",
                                                        "four\r\n",
                                                        "\r\n\r\n",
                                                        "five\r\n",
                                                        "Exit status: 0"])
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
foreman_remote_execution-4.3.1 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.3.0 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.2.3 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.2.2 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.2.1 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.2.0 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.1.0 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.7 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-4.0.0 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.6 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.5 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.4 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.3 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.2.2 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.2 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.1 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.3.0 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.2.1 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.2.0 test/helpers/remote_execution_helper_test.rb
foreman_remote_execution-3.1.0 test/helpers/remote_execution_helper_test.rb