pickle 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,5 +1,5 @@
1
1
  pkg
2
2
  doc/*
3
- .garlic
4
- webrat*
5
- cucumber_test_app
3
+ .yardoc
4
+ pickle-email*
5
+ cucumber_test_app
@@ -1,3 +1,8 @@
1
+ == 0.2.8 - 5 Apr 2010
2
+
3
+ * 1 minor improvement
4
+ * 'Then show me the email' works as expected now [#18]
5
+
1
6
  == 0.2.7 - 5 Apr 2010
2
7
 
3
8
  * 1 minor improvement
data/Rakefile CHANGED
@@ -30,7 +30,7 @@ end
30
30
  namespace :rcov do
31
31
  desc "Verify RCov threshold for #{PluginName}"
32
32
  RCov::VerifyTask.new(:verify => :rcov) do |t|
33
- t.threshold = 99.23
33
+ t.threshold = 98.67
34
34
  t.index_html = File.join(File.dirname(__FILE__), 'doc/coverage/index.html')
35
35
  end
36
36
  end
@@ -81,4 +81,15 @@ begin
81
81
 
82
82
  rescue LoadError
83
83
  puts "Jeweler not available for gem tasks. Install it with: sudo gem install jeweler"
84
+ end
85
+
86
+ begin
87
+ require 'yard'
88
+
89
+ YARD::Rake::YardocTask.new(:doc) do |t|
90
+ t.files = ['lib/**/*.rb', 'generators/**/*.rb']
91
+ end
92
+
93
+ rescue LoadError
94
+ puts "YARD not available for doc tasks. Install it with: sudo gem install yard"
84
95
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
@@ -58,3 +58,7 @@ Feature: I can test emails are sent
58
58
  Then 1 email should be delivered to the user
59
59
  And I follow "example page" in the email
60
60
  Then I should be at the user's page
61
+
62
+ Scenario: Save and open email
63
+ Given an email "Gday" with body: "Gday Mate" is delivered to fred@gmail.com
64
+ Then show me the email
@@ -30,11 +30,18 @@ module Pickle
30
30
  end
31
31
 
32
32
  protected
33
+ def open_in_browser(path) # :nodoc
34
+ require "launchy"
35
+ Launchy::Browser.run(path)
36
+ rescue LoadError
37
+ warn "Sorry, you need to install launchy to open emails: `gem install launchy`"
38
+ end
39
+
33
40
  # Saves the emails out to RAILS_ROOT/tmp/ and opens it in the default
34
41
  # web browser if on OS X. (depends on webrat)
35
42
  def save_and_open_emails
36
43
  emails_to_open = @emails || emails
37
- filename = "webrat-email-#{Time.now.to_i}.html"
44
+ filename = "pickle-email-#{Time.now.to_i}.html"
38
45
  File.open(filename, "w") do |f|
39
46
  emails_to_open.each_with_index do |e, i|
40
47
  f.write "<h1>Email #{i+1}</h1><pre>#{e}</pre><hr />"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.2.7"
8
+ s.version = "0.2.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian White"]
@@ -102,7 +102,6 @@ describe Pickle::Email do
102
102
 
103
103
  describe "#save_and_open_emails" do
104
104
  before do
105
- stub!(:open_in_browser)
106
105
  stub!(:emails).and_return(["Contents of Email 1"])
107
106
  @now = "2008-01-01".to_time
108
107
  Time.stub!(:now).and_return(@now)
@@ -124,11 +123,11 @@ describe Pickle::Email do
124
123
 
125
124
  it "should create a file in Rails/tmp with the emails in it" do
126
125
  save_and_open_emails
127
- File.read("webrat-email-#{@now.to_i}.html").should == "<h1>Email 1</h1><pre>Contents of Email 1</pre><hr />"
126
+ File.read("pickle-email-#{@now.to_i}.html").should == "<h1>Email 1</h1><pre>Contents of Email 1</pre><hr />"
128
127
  end
129
128
 
130
129
  it "should call open_in_browser on created tmp file" do
131
- should_receive(:open_in_browser).with("webrat-email-#{@now.to_i}.html")
130
+ should_receive(:open_in_browser).with("pickle-email-#{@now.to_i}.html")
132
131
  save_and_open_emails
133
132
  end
134
133
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 7
9
- version: 0.2.7
8
+ - 8
9
+ version: 0.2.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ian White