ndd-rspec 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,22 +5,22 @@ HOST_OS = RbConfig::CONFIG['host_os']
5
5
 
6
6
  # ------------------------------------------------------------------------------
7
7
  # Dependencies required to use the gem.
8
- gem 'rspec', '~> 2.11.0'
8
+ gem 'rspec', '~> 2.0'
9
9
 
10
10
 
11
11
  # ------------------------------------------------------------------------------
12
12
  # Dependencies to develop the gem.
13
13
  # Everything needed to run rake, tests, features, etc.
14
14
  group :development do
15
- gem 'bundler', '~> 1.2.0'
16
- gem 'guard', '~> 1.5.0'
17
- gem 'guard-bundler', '~> 1.0.0'
18
- gem 'guard-rspec', '~> 2.1.0'
19
- gem 'guard-spork', '~> 1.2.0'
20
- gem 'jeweler', '~> 1.8.4'
15
+ gem 'bundler', '~> 1.2'
16
+ gem 'guard', '~> 1.0'
17
+ gem 'guard-bundler', '~> 1.0'
18
+ gem 'guard-rspec', '~> 2.0'
19
+ gem 'guard-spork', '~> 1.0'
20
+ gem 'jeweler', '~> 1.8'
21
21
  gem 'rdoc', '~> 3.12'
22
- gem 'rspec', '~> 2.11.0'
23
- gem 'simplecov', '~> 0.7.0', :require => false
22
+ #gem 'rspec', '~> 2.0'
23
+ gem 'simplecov', '~> 0.7', :require => false
24
24
 
25
25
  case HOST_OS
26
26
  when /darwin/i
data/Gemfile.lock CHANGED
@@ -5,9 +5,9 @@ GEM
5
5
  ffi (~> 1.0, >= 1.0.6)
6
6
  coderay (1.0.8)
7
7
  diff-lcs (1.1.3)
8
- ffi (1.1.5)
8
+ ffi (1.2.0)
9
9
  git (1.2.5)
10
- guard (1.5.0)
10
+ guard (1.5.4)
11
11
  listen (>= 0.4.2)
12
12
  lumberjack (>= 1.0.2)
13
13
  pry (>= 0.9.10)
@@ -15,14 +15,13 @@ GEM
15
15
  guard-bundler (1.0.0)
16
16
  bundler (~> 1.0)
17
17
  guard (~> 1.1)
18
- guard-rspec (2.1.0)
18
+ guard-rspec (2.3.1)
19
19
  guard (>= 1.1)
20
20
  rspec (~> 2.11)
21
- guard-spork (1.2.1)
21
+ guard-spork (1.4.0)
22
22
  childprocess (>= 0.2.3)
23
23
  guard (>= 1.1)
24
24
  spork (>= 0.8.4)
25
- sys-proctable
26
25
  jeweler (1.8.4)
27
26
  bundler (~> 1.0)
28
27
  git (>= 1.2.5)
@@ -31,48 +30,47 @@ GEM
31
30
  json (1.7.5)
32
31
  libnotify (0.8.0)
33
32
  ffi (>= 1.0.11)
34
- listen (0.5.3)
33
+ listen (0.6.0)
35
34
  lumberjack (1.0.2)
36
35
  method_source (0.8.1)
37
- multi_json (1.3.6)
36
+ multi_json (1.5.0)
38
37
  pry (0.9.10)
39
38
  coderay (~> 1.0.5)
40
39
  method_source (~> 0.8)
41
40
  slop (~> 3.3.1)
42
- rake (0.9.2.2)
41
+ rake (10.0.3)
43
42
  rb-inotify (0.8.8)
44
43
  ffi (>= 0.5.0)
45
44
  rdoc (3.12)
46
45
  json (~> 1.4)
47
- rspec (2.11.0)
48
- rspec-core (~> 2.11.0)
49
- rspec-expectations (~> 2.11.0)
50
- rspec-mocks (~> 2.11.0)
51
- rspec-core (2.11.1)
52
- rspec-expectations (2.11.3)
46
+ rspec (2.12.0)
47
+ rspec-core (~> 2.12.0)
48
+ rspec-expectations (~> 2.12.0)
49
+ rspec-mocks (~> 2.12.0)
50
+ rspec-core (2.12.1)
51
+ rspec-expectations (2.12.0)
53
52
  diff-lcs (~> 1.1.3)
54
- rspec-mocks (2.11.3)
53
+ rspec-mocks (2.12.0)
55
54
  simplecov (0.7.1)
56
55
  multi_json (~> 1.0)
57
56
  simplecov-html (~> 0.7.1)
58
57
  simplecov-html (0.7.1)
59
58
  slop (3.3.3)
60
59
  spork (0.9.2)
61
- sys-proctable (0.9.2)
62
60
  thor (0.16.0)
63
61
 
64
62
  PLATFORMS
65
63
  ruby
66
64
 
67
65
  DEPENDENCIES
68
- bundler (~> 1.2.0)
69
- guard (~> 1.5.0)
70
- guard-bundler (~> 1.0.0)
71
- guard-rspec (~> 2.1.0)
72
- guard-spork (~> 1.2.0)
73
- jeweler (~> 1.8.4)
66
+ bundler (~> 1.2)
67
+ guard (~> 1.0)
68
+ guard-bundler (~> 1.0)
69
+ guard-rspec (~> 2.0)
70
+ guard-spork (~> 1.0)
71
+ jeweler (~> 1.8)
74
72
  libnotify
75
73
  rb-inotify
76
74
  rdoc (~> 3.12)
77
- rspec (~> 2.11.0)
78
- simplecov (~> 0.7.0)
75
+ rspec (~> 2.0)
76
+ simplecov (~> 0.7)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -7,6 +7,10 @@ module Ndd
7
7
  module RSpec
8
8
  module Matchers
9
9
 
10
+ def be_reverse_sorted_by(attribute)
11
+ BeReverseSortedBy.new(attribute)
12
+ end
13
+
10
14
  # ----------------------------------------------------------------------------------------------------------------
11
15
  # Ensures that an enumerable (responding to <code>Enumerable#collect</code>) is sorted by the given attribute in reverse order
12
16
  #
@@ -27,6 +31,10 @@ module Ndd
27
31
  @sorted_attributes == @actual_attributes
28
32
  end
29
33
 
34
+ def description
35
+ "be sorted by '#@attribute' in reverse order"
36
+ end
37
+
30
38
  def failure_message_for_should
31
39
  return <<-MESSAGE
32
40
 
@@ -7,6 +7,10 @@ module Ndd
7
7
  module RSpec
8
8
  module Matchers
9
9
 
10
+ def be_sorted_by(attribute)
11
+ BeSortedBy.new(attribute)
12
+ end
13
+
10
14
  # ----------------------------------------------------------------------------------------------------------------
11
15
  # Ensures that an enumerable (responding to <code>Enumerable#collect</code>) is sorted by the given attribute.
12
16
  #
@@ -27,6 +31,10 @@ module Ndd
27
31
  @sorted_attributes == @actual_attributes
28
32
  end
29
33
 
34
+ def description
35
+ "be sorted by '#@attribute'"
36
+ end
37
+
30
38
  def failure_message_for_should
31
39
  return <<-MESSAGE
32
40
 
@@ -2,18 +2,7 @@
2
2
  require_relative 'matchers/be_reverse_sorted_by'
3
3
  require_relative 'matchers/be_sorted_by'
4
4
 
5
- module Ndd
6
- module RSpec
7
- module Matchers
8
5
 
9
- def be_reverse_sorted_by(attribute)
10
- BeReverseSortedBy.new(attribute)
11
- end
12
-
13
- def be_sorted_by(attribute)
14
- BeSortedBy.new(attribute)
15
- end
16
-
17
- end
18
- end
6
+ module RSpec::Matchers
7
+ include Ndd::RSpec::Matchers
19
8
  end
data/ndd-rspec.gemspec ADDED
@@ -0,0 +1,87 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "ndd-rspec"
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["David DIDIER"]
12
+ s.date = "2012-12-13"
13
+ s.description = "RSpec utilities"
14
+ s.email = "c_inconnu2@yahoo.fr"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".travis.yml",
22
+ "CHANGELOG.md",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "Guardfile",
26
+ "LICENSE.txt",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "lib/ndd/rspec/matchers.rb",
31
+ "lib/ndd/rspec/matchers/be_reverse_sorted_by.rb",
32
+ "lib/ndd/rspec/matchers/be_sorted_by.rb",
33
+ "ndd-rspec.gemspec",
34
+ "spec/ndd/rspec/matchers/be_reverse_sorted_by_spec.rb",
35
+ "spec/ndd/rspec/matchers/be_sorted_by_spec.rb",
36
+ "spec/ndd/rspec/matchers/shared_examples.rb",
37
+ "spec/spec_helper.rb"
38
+ ]
39
+ s.homepage = "http://github.com/ddidier/ndd-rspec"
40
+ s.licenses = ["MIT"]
41
+ s.require_paths = ["lib"]
42
+ s.rubygems_version = "1.8.24"
43
+ s.summary = "RSpec utilities"
44
+
45
+ if s.respond_to? :specification_version then
46
+ s.specification_version = 3
47
+
48
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
+ s.add_runtime_dependency(%q<rspec>, ["~> 2.0"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.2"])
51
+ s.add_development_dependency(%q<guard>, ["~> 1.0"])
52
+ s.add_development_dependency(%q<guard-bundler>, ["~> 1.0"])
53
+ s.add_development_dependency(%q<guard-rspec>, ["~> 2.0"])
54
+ s.add_development_dependency(%q<guard-spork>, ["~> 1.0"])
55
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8"])
56
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
57
+ s.add_development_dependency(%q<simplecov>, ["~> 0.7"])
58
+ s.add_development_dependency(%q<libnotify>, [">= 0"])
59
+ s.add_development_dependency(%q<rb-inotify>, [">= 0"])
60
+ else
61
+ s.add_dependency(%q<rspec>, ["~> 2.0"])
62
+ s.add_dependency(%q<bundler>, ["~> 1.2"])
63
+ s.add_dependency(%q<guard>, ["~> 1.0"])
64
+ s.add_dependency(%q<guard-bundler>, ["~> 1.0"])
65
+ s.add_dependency(%q<guard-rspec>, ["~> 2.0"])
66
+ s.add_dependency(%q<guard-spork>, ["~> 1.0"])
67
+ s.add_dependency(%q<jeweler>, ["~> 1.8"])
68
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
69
+ s.add_dependency(%q<simplecov>, ["~> 0.7"])
70
+ s.add_dependency(%q<libnotify>, [">= 0"])
71
+ s.add_dependency(%q<rb-inotify>, [">= 0"])
72
+ end
73
+ else
74
+ s.add_dependency(%q<rspec>, ["~> 2.0"])
75
+ s.add_dependency(%q<bundler>, ["~> 1.2"])
76
+ s.add_dependency(%q<guard>, ["~> 1.0"])
77
+ s.add_dependency(%q<guard-bundler>, ["~> 1.0"])
78
+ s.add_dependency(%q<guard-rspec>, ["~> 2.0"])
79
+ s.add_dependency(%q<guard-spork>, ["~> 1.0"])
80
+ s.add_dependency(%q<jeweler>, ["~> 1.8"])
81
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
82
+ s.add_dependency(%q<simplecov>, ["~> 0.7"])
83
+ s.add_dependency(%q<libnotify>, [">= 0"])
84
+ s.add_dependency(%q<rb-inotify>, [">= 0"])
85
+ end
86
+ end
87
+
@@ -23,6 +23,12 @@ describe "be reverse sorted by", { :type => 'matcher' } do
23
23
  UNSORTED_ARRAY.should_not be_reverse_sorted_by(:to_i)
24
24
  end
25
25
 
26
+ it "describes itself" do
27
+ matcher = be_reverse_sorted_by(:to_i)
28
+ matcher.matches?(REVERSE_SORTED_ARRAY)
29
+ matcher.description.should == "be sorted by 'to_i' in reverse order"
30
+ end
31
+
26
32
  it "provides message on #failure_message" do
27
33
  matcher = be_reverse_sorted_by(:to_i)
28
34
  matcher.matches?(UNSORTED_ARRAY)
@@ -23,6 +23,12 @@ describe "be sorted by", { :type => 'matcher' } do
23
23
  UNSORTED_ARRAY.should_not be_sorted_by(:to_i)
24
24
  end
25
25
 
26
+ it "describes itself" do
27
+ matcher = be_sorted_by(:to_i)
28
+ matcher.matches?(SORTED_ARRAY)
29
+ matcher.description.should == "be sorted by 'to_i'"
30
+ end
31
+
26
32
  it "provides message on #failure_message" do
27
33
  matcher = be_sorted_by(:to_i)
28
34
  matcher.matches?(UNSORTED_ARRAY)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndd-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-10-24 00:00:00.000000000 Z
12
+ date: 2012-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.11.0
21
+ version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 2.11.0
29
+ version: '2.0'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bundler
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 1.2.0
37
+ version: '1.2'
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 1.2.0
45
+ version: '1.2'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: guard
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 1.5.0
53
+ version: '1.0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 1.5.0
61
+ version: '1.0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: guard-bundler
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 1.0.0
69
+ version: '1.0'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 1.0.0
77
+ version: '1.0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: guard-rspec
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - ~>
84
84
  - !ruby/object:Gem::Version
85
- version: 2.1.0
85
+ version: '2.0'
86
86
  type: :development
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: 2.1.0
93
+ version: '2.0'
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: guard-spork
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 1.2.0
101
+ version: '1.0'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 1.2.0
109
+ version: '1.0'
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: jeweler
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 1.8.4
117
+ version: '1.8'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 1.8.4
125
+ version: '1.8'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: rdoc
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -139,22 +139,6 @@ dependencies:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
141
  version: '3.12'
142
- - !ruby/object:Gem::Dependency
143
- name: rspec
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ~>
148
- - !ruby/object:Gem::Version
149
- version: 2.11.0
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ~>
156
- - !ruby/object:Gem::Version
157
- version: 2.11.0
158
142
  - !ruby/object:Gem::Dependency
159
143
  name: simplecov
160
144
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +146,7 @@ dependencies:
162
146
  requirements:
163
147
  - - ~>
164
148
  - !ruby/object:Gem::Version
165
- version: 0.7.0
149
+ version: '0.7'
166
150
  type: :development
167
151
  prerelease: false
168
152
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,7 +154,7 @@ dependencies:
170
154
  requirements:
171
155
  - - ~>
172
156
  - !ruby/object:Gem::Version
173
- version: 0.7.0
157
+ version: '0.7'
174
158
  - !ruby/object:Gem::Dependency
175
159
  name: libnotify
176
160
  requirement: !ruby/object:Gem::Requirement
@@ -224,6 +208,7 @@ files:
224
208
  - lib/ndd/rspec/matchers.rb
225
209
  - lib/ndd/rspec/matchers/be_reverse_sorted_by.rb
226
210
  - lib/ndd/rspec/matchers/be_sorted_by.rb
211
+ - ndd-rspec.gemspec
227
212
  - spec/ndd/rspec/matchers/be_reverse_sorted_by_spec.rb
228
213
  - spec/ndd/rspec/matchers/be_sorted_by_spec.rb
229
214
  - spec/ndd/rspec/matchers/shared_examples.rb
@@ -243,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
228
  version: '0'
244
229
  segments:
245
230
  - 0
246
- hash: 3507608324869974558
231
+ hash: 3372791830405890157
247
232
  required_rubygems_version: !ruby/object:Gem::Requirement
248
233
  none: false
249
234
  requirements: