Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changes need to get tests passing in niecza.

  • Loading branch information...
commit 21a732f6c415bf0c04ed2fc9289ae59d871f20bb 1 parent da4c718
@colomon authored
Showing with 14 additions and 5 deletions.
  1. +12 −3 lib/Email/Simple/Header.pm6
  2. +2 −2 t/basic.t
View
15 lib/Email/Simple/Header.pm6
@@ -37,7 +37,7 @@ multi method new (Array @headers, Str :$crlf = "\r\n") {
multi method new (Str $header-text, Str :$crlf = "\r\n") {
my $parsed = Headers.parse($header-text);
- my @entries = $parsed<entry>;
+ my @entries = $parsed<entry>.list;
my @headers;
for @entries {
my $name = $_<name>;
@@ -64,8 +64,17 @@ method as-string {
}
method Str { self.as-string }
-class HeaderResponse is Array {
- method Str { self[0] }
+class HeaderResponse is Positional {
+ has @.values;
+
+ method new(@values) {
+ self.bless(*, :@values);
+ }
+
+ method get_at($k) { @.values.get_at($k) }
+ method list() { @.values.list }
+
+ method Str { @.values[0] }
}
method header-names {
View
4 t/basic.t
@@ -5,12 +5,12 @@ BEGIN { @*INC.push: './lib'; }
use Email::Simple;
+plan 3;
+
my $mail-text = slurp './t/test-mails/josey-nofold';
my $mail = Email::Simple.new($mail-text);
-plan 3;
-
my $old-from;
is $old-from = $mail.header('From'), 'Andrew Josey <ajosey@rdg.opengroup.org>', "We can get a header";
my $sc = 'Simon Cozens <simon@cpan.org>';
Please sign in to comment.
Something went wrong with that request. Please try again.