spec_support 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -46,13 +46,13 @@ Specifically, without the delete_nil_values, this error results:
46
46
 
47
47
  null value in column "created_at" violates not-null constraint
48
48
 
49
- == factory_hash
49
+ == present_attributes
50
50
 
51
- This is a combined function that executes the
51
+ SpecSupport.present_attributes(m)
52
52
 
53
- .attributes.delete_nil_values
53
+ is a combined function that executes
54
+
55
+ m.attributes.delete_nil_values
54
56
 
55
57
  shown above as valid_attributes on a ActiveRecord model
56
58
  (typically produced with FactoryGirl)
57
-
58
-
@@ -6,9 +6,9 @@ class Hash
6
6
 
7
7
  end
8
8
 
9
- class Object
9
+ module SpecSupport
10
10
 
11
- def factory_hash(m)
11
+ def self.present_attributes(m)
12
12
  m.attributes.delete_nil_values
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module SpecSupport
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -20,11 +20,16 @@ describe "delete_nil_values" do
20
20
 
21
21
  end
22
22
 
23
- describe "factory_hash" do
23
+ describe "present_attributes" do
24
24
 
25
25
  it "yields a non_nil values" do
26
26
  m = OpenStruct.new(:attributes => {:a => 'c', :b => nil})
27
- factory_hash(m).should == {:a => 'c'}
27
+ SpecSupport.present_attributes(m).should == {:a => 'c'}
28
+ end
29
+
30
+ it "is not defined on Object" do
31
+ m = OpenStruct.new(:attributes => {:a => 'c', :b => nil})
32
+ lambda {Object.new.present_attributes(m)}.should raise_error
28
33
  end
29
34
 
30
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spec_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-19 00:00:00.000000000 Z
12
+ date: 2012-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -34,17 +34,17 @@ executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - lib/spec_support/check_all_columns.rb
38
37
  - lib/spec_support/version.rb
38
+ - lib/spec_support/check_all_columns.rb
39
39
  - lib/spec_support/delete_nil_values.rb
40
40
  - lib/spec_support.rb
41
41
  - lib/tasks/spec_support_tasks.rake
42
42
  - MIT-LICENSE
43
43
  - Rakefile
44
44
  - README.rdoc
45
- - spec/file_spec.rb
46
- - spec/delete_nil_values_spec.rb
47
45
  - spec/spec_helper.rb
46
+ - spec/delete_nil_values_spec.rb
47
+ - spec/file_spec.rb
48
48
  homepage: http://github.com/petervandenabeele/spec_support
49
49
  licenses: []
50
50
  post_install_message:
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  segments:
61
61
  - 0
62
- hash: -975297039
62
+ hash: 577299729
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  segments:
70
70
  - 0
71
- hash: -975297039
71
+ hash: 577299729
72
72
  requirements: []
73
73
  rubyforge_project:
74
74
  rubygems_version: 1.8.23
@@ -76,6 +76,6 @@ signing_key:
76
76
  specification_version: 3
77
77
  summary: spec/support for common cases
78
78
  test_files:
79
- - spec/file_spec.rb
80
- - spec/delete_nil_values_spec.rb
81
79
  - spec/spec_helper.rb
80
+ - spec/delete_nil_values_spec.rb
81
+ - spec/file_spec.rb