File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 require "smtp_tls"
99end
1010
11- class Object
12- def to_imap_date
13- date = respond_to? ( :utc ) ? utc . to_s : to_s
14- Date . parse ( date ) . strftime ( "%d-%b-%Y" )
15- end
16- end
17-
1811module Gmail
1912 autoload :Version , "gmail/version"
2013 autoload :Client , "gmail/client"
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ def fetch_uids(*args)
3232 search = MAILBOX_ALIASES [ args . shift ] . dup
3333 opts = args . first . is_a? ( Hash ) ? args . first : { }
3434
35- opts [ :after ] and search . concat [ 'SINCE' , opts [ :after ] . to_imap_date ]
36- opts [ :before ] and search . concat [ 'BEFORE' , opts [ :before ] . to_imap_date ]
35+ opts [ :after ] and search . concat [ 'SINCE' , Net :: IMAP . format_date ( opts [ :after ] ) ]
36+ opts [ :before ] and search . concat [ 'BEFORE' , Net :: IMAP . format_date ( opts [ :before ] ) ]
3737 opts [ :on ] and search . concat [ 'ON' , opts [ :on ] . to_imap_date ]
3838 opts [ :from ] and search . concat [ 'FROM' , opts [ :from ] ]
3939 opts [ :to ] and search . concat [ 'TO' , opts [ :to ] ]
Original file line number Diff line number Diff line change 11require 'spec_helper'
2+ require 'net/imap'
23
34describe Gmail do
45 it "should be able to convert itself to IMAP date format" do
5- expect ( "20-12-1988" . to_imap_date ) . to eq ( "20-Dec-1988" )
6+ expect ( Net :: IMAP . format_date ( Date . new ( 1988 , 12 , 20 ) ) ) . to eq ( "20-Dec-1988" )
67 end
78
89 %w[ new new! ] . each do |method |
You can’t perform that action at this time.
0 commit comments