Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bacon tests to work under ruby 1.9.2.

  • Loading branch information...
commit 656e2334f89db56bd2caeeb24e0d13e9b514b873 1 parent 07a1b52
@DirtYiCE DirtYiCE authored committed
View
2  spec/helper.rb
@@ -1,5 +1,5 @@
require File.expand_path("#{__FILE__}/../../lib/mailit")
require 'bacon'
-require 'Tempfile'
+require 'tempfile'
Bacon.summary_on_exit
View
10 spec/mailit/mail.rb
@@ -1,5 +1,5 @@
# Encoding: UTF-8
-require 'spec/helper'
+require File.join(File.dirname(__FILE__), '..', 'helper')
# The specs are translated from the Test::Unit tests of MailFactory.
#
@@ -105,7 +105,7 @@
mail.to_s.should.include('<a href=3D"http://google.com">click here</a>')
end
-
+
should 'make mail with a single attachment' do
mail = Mailit::Mail.new
tempfile = Tempfile.new('adw')
@@ -115,7 +115,7 @@
mail.attachments.first[:attachment].should.be == tempfile.read
mail.attachments.first[:filename].should == Pathname.new(tempfile.path).basename
end
-
+
should 'make mail with a single attachment and given filename' do
mail = Mailit::Mail.new
tempfile = Tempfile.new('adw')
@@ -126,7 +126,7 @@
mail.attachments.first[:attachment].should.be == tempfile.read
mail.attachments.first[:filename].should == filename
end
-
+
should 'make mail with multiple attachments and given filenames' do
mail = Mailit::Mail.new
tempfile1 = Tempfile.new('adw')
@@ -143,5 +143,5 @@
mail.attachments[1][:attachment].should.be == tempfile2.read
mail.attachments[1][:filename].should == tempfile2_filename
end
-
+
end
View
2  spec/mailit/mailer.rb
@@ -1,4 +1,4 @@
-require 'spec/helper'
+require File.join(File.dirname(__FILE__), '..', 'helper')
class MockSMTP
INSTANCES = []
View
2  tasks/bacon.rake
@@ -23,7 +23,7 @@ task :bacon => :install_dependencies do
specs.each_with_index do |spec, idx|
print(left_format % [idx + 1, specs_size, spec])
- Open3.popen3(RUBY, spec) do |sin, sout, serr|
+ Open3.popen3(RUBY, File.join(File.dirname(__FILE__), '..', spec)) do |sin, sout, serr|
out = sout.read.strip
err = serr.read.strip
Please sign in to comment.
Something went wrong with that request. Please try again.