pickle 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,10 @@
1
+ == 0.3.4
2
+
3
+ * 2 minor improvements
4
+ * Fix problem where email body is not a string, but is string like [#26] [Tom Meier]
5
+ * Minor code refactoring
6
+
7
+
1
8
  == 0.3.3
2
9
 
3
10
  * 1 minor improvement
@@ -328,6 +328,7 @@ To run the features (rails 2.3 only ATM):
328
328
 
329
329
  The following people have made Pickle better:
330
330
 
331
+ * {Tom Meier}[http://github.com/tommeier]
331
332
  * {Sean Hussey}[http://github.com/seanhussey]
332
333
  * Brian Rose & Kevin Olsen
333
334
  * {Christopher Darroch}[http://github.com/chrisdarroch]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -1,5 +1,3 @@
1
- require 'ostruct'
2
-
3
1
  module Pickle
4
2
  class Config
5
3
  attr_writer :adapters, :factories, :mappings, :predicates
@@ -31,6 +29,9 @@ module Pickle
31
29
  k.public_instance_methods.select {|m| m =~ /\?$/} + Pickle::Adapter.column_names(k)
32
30
  end.flatten.uniq
33
31
  end
32
+
33
+ class Mapping < Struct.new(:search, :replacement)
34
+ end
34
35
 
35
36
  def mappings
36
37
  @mappings ||= []
@@ -41,7 +42,7 @@ module Pickle
41
42
  options = args.extract_options!
42
43
  raise ArgumentError, "Usage: map 'search' [, 'search2', ...] :to => 'replace'" unless args.any? && options[:to].is_a?(String)
43
44
  args.each do |search|
44
- self.mappings << OpenStruct.new(:search => search, :replacement => options[:to])
45
+ self.mappings << Mapping.new(search, options[:to])
45
46
  end
46
47
  end
47
48
  end
@@ -70,7 +70,7 @@ module Pickle
70
70
  end
71
71
 
72
72
  def links_in_email(email, protos=['http', 'https'])
73
- URI.extract(email.body, protos)
73
+ URI.extract(email.body.to_s, protos)
74
74
  end
75
75
 
76
76
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
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"]
12
- s.date = %q{2010-08-05}
12
+ s.date = %q{2010-08-06}
13
13
  s.description = %q{Easy model creation and reference in your cucumber features}
14
14
  s.email = %q{ian.w.white@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -80,8 +80,12 @@ describe Pickle::Config do
80
80
  @config.map 'foo', :to => 'faz'
81
81
  end
82
82
 
83
- it "should create OpenStruct(search: 'foo', replace: 'faz') mapping" do
84
- @config.mappings.first.should == OpenStruct.new(:search => 'foo', :replacement => 'faz')
83
+ it "should create Mapping('foo', 'faz') mapping" do
84
+ @config.mappings.first.tap do |mapping|
85
+ mapping.should be_kind_of Pickle::Config::Mapping
86
+ mapping.search.should == 'foo'
87
+ mapping.replacement.should == 'faz'
88
+ end
85
89
  end
86
90
  end
87
91
 
@@ -91,8 +95,8 @@ describe Pickle::Config do
91
95
  end
92
96
 
93
97
  it "should create 2 mappings" do
94
- @config.mappings.first.should == OpenStruct.new(:search => 'foo', :replacement => 'faz')
95
- @config.mappings.last.should == OpenStruct.new(:search => 'bar', :replacement => 'faz')
98
+ @config.mappings.first.should == Pickle::Config::Mapping.new('foo', 'faz')
99
+ @config.mappings.last.should == Pickle::Config::Mapping.new('bar', 'faz')
96
100
  end
97
101
  end
98
102
 
@@ -156,5 +156,11 @@ describe Pickle::Email do
156
156
  should_receive(:visit).with('http://example.com/page')
157
157
  click_first_link_in_email(@email1)
158
158
  end
159
+
160
+ it "should not raise an error when the email body is not a string, but needs to_s [#26]" do
161
+ stub!(:visit)
162
+ @email1.stub!(:body).and_return(:a_string_body)
163
+ lambda { click_first_link_in_email(@email1) }.should_not raise_error
164
+ end
159
165
  end
160
166
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 3
10
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ian White
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-05 00:00:00 +01:00
18
+ date: 2010-08-06 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21