ku_fu 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/ku_fu.gemspec CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency "activerecord"
22
22
 
23
23
  # specify any dependencies here; for example:
24
+ s.add_development_dependency "rake"
24
25
  s.add_development_dependency "rspec"
25
26
  s.add_development_dependency "sqlite3"
26
27
  s.add_development_dependency "rspec_junit_formatter"
data/lib/ku_fu.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require "ku_fu/version"
2
2
  require "ku_fu/base"
3
+ require "ku_fu/matchers/rspec_matchers" if defined?(RSpec)
@@ -0,0 +1,6 @@
1
+ RSpec::Matchers.define :register_ku_fu do |attribute|
2
+ match do |model|
3
+ m = model.respond_to?(:new) ? model.new : model
4
+ m.respond_to?("ku_fu_register")
5
+ end
6
+ end
data/lib/ku_fu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KuFu
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,8 @@
1
+ require "spec_helper"
2
+
3
+ describe "rspec matchers" do
4
+
5
+ it { Document.should register_ku_fu}
6
+ it { Object.should_not register_ku_fu}
7
+
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ku_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
- requirement: &70152357664280 !ruby/object:Gem::Requirement
16
+ requirement: &70215117344520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,21 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70152357664280
24
+ version_requirements: *70215117344520
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &70215117344100 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70215117344100
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: rspec
27
- requirement: &70152357663860 !ruby/object:Gem::Requirement
38
+ requirement: &70215117343600 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,10 +43,10 @@ dependencies:
32
43
  version: '0'
33
44
  type: :development
34
45
  prerelease: false
35
- version_requirements: *70152357663860
46
+ version_requirements: *70215117343600
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: sqlite3
38
- requirement: &70152357655900 !ruby/object:Gem::Requirement
49
+ requirement: &70215117332180 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,10 +54,10 @@ dependencies:
43
54
  version: '0'
44
55
  type: :development
45
56
  prerelease: false
46
- version_requirements: *70152357655900
57
+ version_requirements: *70215117332180
47
58
  - !ruby/object:Gem::Dependency
48
59
  name: rspec_junit_formatter
49
- requirement: &70152357655220 !ruby/object:Gem::Requirement
60
+ requirement: &70215117331420 !ruby/object:Gem::Requirement
50
61
  none: false
51
62
  requirements:
52
63
  - - ! '>='
@@ -54,7 +65,7 @@ dependencies:
54
65
  version: '0'
55
66
  type: :development
56
67
  prerelease: false
57
- version_requirements: *70152357655220
68
+ version_requirements: *70215117331420
58
69
  description: register who created, updated or deleted an active record object
59
70
  email:
60
71
  - acampolonghi@gmail.com
@@ -69,8 +80,10 @@ files:
69
80
  - ku_fu.gemspec
70
81
  - lib/ku_fu.rb
71
82
  - lib/ku_fu/base.rb
83
+ - lib/ku_fu/matchers/rspec_matchers.rb
72
84
  - lib/ku_fu/version.rb
73
85
  - spec/ku_fu_spec.rb
86
+ - spec/matchers_spec.rb
74
87
  - spec/spec_helper.rb
75
88
  - spec/support/document.rb
76
89
  - spec/support/user.rb
@@ -100,6 +113,7 @@ specification_version: 3
100
113
  summary: register who created, updated or deleted an active record object
101
114
  test_files:
102
115
  - spec/ku_fu_spec.rb
116
+ - spec/matchers_spec.rb
103
117
  - spec/spec_helper.rb
104
118
  - spec/support/document.rb
105
119
  - spec/support/user.rb