File: 0006-Test-header-params-without-order-guarantee.patch

package info (click to toggle)
ruby-rubymail 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,056 kB
  • sloc: ruby: 6,061; makefile: 7
file content (27 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Per Andersson <avtobiff@gmail.com>
Date: Thu, 7 Jun 2012 19:37:41 +0200
Subject: Test header params without order guarantee.

---
 test/testheader.rb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/test/testheader.rb b/test/testheader.rb
index 3c759dc..3e03b08 100644
--- a/test/testheader.rb
+++ b/test/testheader.rb
@@ -209,7 +209,12 @@ class TestRMailHeader < TestBase
     # Test the params argument
     h = RMail::Header.new
     h.add("name", "value", nil, 'param1' => 'value1', 'param2' => '+value2')
-    assert_equal('value; param1=value1; param2="+value2"', h['name'])
+    # Param order can not be guaranteed since they are given as dict to the
+    # function.
+    #assert_equal('value; param1=value1; param2="+value2"', h['name'])
+    header_check = (h['name'] == 'value; param1=value1; param2="+value2"' or
+                    h['name'] == 'value; param2="+value2"; param1=value1')
+    assert(header_check)
 
     h = RMail::Header.new
     h.add_raw("MIME-Version: 1.0")
--