Permalink
Browse files

Add the first spec

Also add the Guardfile for autotest, etc.
  • Loading branch information...
1 parent 99c1afc commit 5709e76147d0b2d541e41f75eb6ed402933eedc4 @ywen2 ywen2 committed Mar 21, 2012
View
2 .rspec
@@ -0,0 +1,2 @@
+--colour
+--format documentation
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm 1.9.3@redis_cache_mailer_delivery
View
@@ -0,0 +1,11 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+# NOTE: When using watch with a block, you must return all files that should be reloaded.
+guard :rspectacle, :cli => '--format documentation --backtrace' do
+ watch('spec/spec_helper.rb') { %w(spec/spec_helper spec) }
+
+ watch(%r{^spec/.+_spec\.rb$})
+
+ watch(%r{^lib/(.+)\.rb$}) { |m| ["lib/#{m[1]}.rb", "spec/lib/#{m[1]}_spec.rb"] }
+end
@@ -1,3 +1,4 @@
+require 'action_mailer'
require 'redis_cache_mailer_delivery/version'
require 'redis_cache_mailer_delivery/mail/cache_delivery'
require 'redis_cache_mailer_delivery/action_mailer/base'
@@ -11,5 +12,5 @@ def install
end # << self
end # RedisCacheMailerDelivery
-require 'redis_cache_mailer_delivery/railtie' if defined?(Rails)
+require 'redis_cache_mailer_delivery/railtie'
require "redis_cache_mailer_delivery/version"
@@ -16,4 +16,9 @@ Gem::Specification.new do |gem|
gem.version = RedisCacheMailerDelivery::VERSION
gem.add_runtime_dependency(%q<redis>)
gem.add_runtime_dependency(%q<redis-objects>)
+ gem.add_runtime_dependency(%q<actionmailer>)
+ gem.add_development_dependency(%q<rspec>)
+ gem.add_development_dependency(%q<guard-rspectacle>)
+ gem.add_development_dependency(%q<growl>)
+ gem.add_development_dependency(%q<rb-fsevent>)
end
@@ -0,0 +1,10 @@
+require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
+
+describe RedisCacheMailerDelivery do
+ describe ".install" do
+ it "adds a delivery method to the ActionMailer" do
+ described_class.install
+ ActionMailer::Base.delivery_methods.should include(:redis_cache => Mail::CacheDelivery)
+ end
+ end
+end
View
@@ -0,0 +1,24 @@
+# Requires supporting files with custom matchers and macros, etc,
+# in ./support/ and its subdirectories.
+require 'rspec/core'
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+require "#{File.dirname(__FILE__)}/../lib/redis_cache_mailer_delivery"
+Dir["#{File.dirname(__FILE__)}/../lib/**/*.rb"].each {|f| require f}
+
+RSpec.configure do |config|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+ # out = ENV['CC_BUILD_ARTIFACTS'] || "#{Rails.root}"
+ # config.output_stream = File.open("#{out}/UnitTests/index.html", "w") if config.formatter_class.name =~ /HtmlFormatter/
+
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, comment the following line or assign false
+ # instead of true.
+end
@@ -0,0 +1,14 @@
+module Rails
+ class Railtie
+ class << self
+ def config
+ Configuration.new
+ end
+ end
+
+ class Configuration
+ def before_configuration
+ end
+ end
+ end
+end

0 comments on commit 5709e76

Please sign in to comment.