Skip to content

Commit b5a2884

Browse files
wktkjeremy
authored andcommitted
Backport fixes for specs on Ruby 1.9.3+
Avoid gems which dropped support for Ruby 1.8: - activesupport (4.0.0) requires ruby (>= 1.9.3) - rake (11.0.1) requires ruby (>= 1.9.3) Backport 6e12d7f to fix #453. Backport db7c955 to fix a brittle spec. References #958
1 parent 6110413 commit b5a2884

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

Gemfile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,28 @@ source 'https://rubygems.org'
22

33
gemspec
44

5-
gem "rake", "< 11.0" if RUBY_VERSION < '1.9.3'
6-
7-
gem "treetop", "~> 1.4.10"
8-
gem "mime-types", "~> 1.16"
5+
gem 'activesupport', '>= 2.3.6' if RUBY_VERSION >= '1.9.3'
6+
gem 'activesupport', '>= 2.3.6', '< 4.0.0' if RUBY_VERSION < '1.9.3'
97
gem "tlsmail" if RUBY_VERSION <= '1.8.6'
8+
gem "mime-types", "~> 1.16"
9+
gem "treetop", "~> 1.4.10"
1010

1111
gem 'jruby-openssl', :platform => :jruby
1212

1313
# For gems not required to run tests
1414
group :local_development, :test do
15+
gem 'rake', '> 0.8.7' if RUBY_VERSION >= '1.9.3'
16+
gem 'rake', '> 0.8.7', '< 11.0.1' if RUBY_VERSION < '1.9.3'
17+
gem 'rdoc', '< 5' if RUBY_VERSION < '1.9'
18+
gem "rspec", "~> 2.8.0"
19+
case
20+
when defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
21+
# Skip it
22+
when RUBY_PLATFORM == 'java'
23+
# Skip it
24+
when RUBY_VERSION < '1.9'
25+
gem "ruby-debug"
26+
else
27+
# Skip it
28+
end
1529
end

spec/mail/message_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ def basic_email
131131

132132
describe "YAML serialization" do
133133
before(:each) do
134+
# Ensure specs don't randomly fail due to messages being generated 1 second apart
135+
time = DateTime.now
136+
DateTime.stub(:now).and_return(time)
137+
134138
@yaml_mail = Mail::Message.new(:to => '[email protected]',
135139
136140
:bcc => '[email protected]',

0 commit comments

Comments
 (0)