spec_support 0.0.8 → 0.0.9
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.
- data/README.rdoc +5 -5
- data/lib/spec_support/delete_nil_values.rb +2 -2
- data/lib/spec_support/version.rb +1 -1
- data/spec/delete_nil_values_spec.rb +7 -2
- metadata +9 -9
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
|
-
==
|
49
|
+
== present_attributes
|
50
50
|
|
51
|
-
|
51
|
+
SpecSupport.present_attributes(m)
|
52
52
|
|
53
|
-
|
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
|
-
|
data/lib/spec_support/version.rb
CHANGED
@@ -20,11 +20,16 @@ describe "delete_nil_values" do
|
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
-
describe "
|
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
|
-
|
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.
|
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-
|
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:
|
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:
|
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
|