ndd-rspec 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d7e52241a8639f89d0305ae38a70d74582f3c1a7
4
+ data.tar.gz: e4f833ee983eae478495902841e4e5f735befb62
5
+ SHA512:
6
+ metadata.gz: c4132f760dfb721ade8f03fbc14d2a84b0175b9fc7bf75f0f21bf7c4bbbabfc1e4c000594caaf0d4824cc2cdf2e2d4733a55b84279b6e13a21fa0f0bd3ebf537
7
+ data.tar.gz: 222318f1a3486bd16f8c8da1a3d01f0ef7181b2a8201930afb8b9faf44b1a6e78a99e8f84860281819b9e1fa46a25dc3a9c9cb7b61d09e0b55a285dd35f57384
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ ndd-rspec
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.1.5
data/.travis.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.5
4
6
  before_install:
5
7
  - gem update --system
6
8
  - gem --version
@@ -8,3 +10,7 @@ branches:
8
10
  only:
9
11
  - master
10
12
  - development
13
+ addons:
14
+ code_climate:
15
+ repo_token:
16
+ secure: sXPF5z5L9A7SLhO5/qU7OrC7xX7AV2chSk5Itv7L4dCKU46Gp2Y4qB18R+jVu2cnikaluL+dtCd203IpzTmGicS/PMNefLfaw/1h5At9X01z/bFVYZyypBJNQ/4bkc+lZ/w1LRfUPWLEhjwvESYwlUKBiVE7a69k/jigrNDTNHA=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # NDD RSpec changelog
2
+
3
+ ## Version 1.0.0
4
+
5
+ * updated Ruby version to 2.1
6
+ * updated RSpec version to 3.1
7
+ * updated version of all development dependencies
8
+ * added CodeClimate test coverage
9
+
1
10
  ## Version 0.1.0
2
11
 
3
12
  * initial commit
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.0'
8
+ gem 'rspec', '~> 3.1'
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'
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
- gem 'rdoc', '~> 3.12'
22
- #gem 'rspec', '~> 2.0'
23
- gem 'simplecov', '~> 0.7', :require => false
15
+ gem 'bundler', '~> 1.7.0', require: false
16
+ gem 'guard', '~> 2.8.0', require: false
17
+ gem 'guard-bundler', '~> 2.0.0', require: false
18
+ gem 'guard-rspec', '~> 4.3.0', require: false
19
+ gem 'guard-spork', '~> 2.0.0', require: false
20
+ gem 'jeweler', '~> 2.0.0', require: false
21
+ gem 'rdoc', '~> 4.1.0', require: false
22
+ gem 'simplecov', '~> 0.9.0', require: false
23
+ gem 'spork', '~> 0.9.0', require: false
24
24
 
25
25
  case HOST_OS
26
26
  when /darwin/i
@@ -38,3 +38,7 @@ group :development do
38
38
  end
39
39
 
40
40
  end
41
+
42
+ group :test do
43
+ gem 'codeclimate-test-reporter', '~> 0.4.0', require: false
44
+ end
data/Gemfile.lock CHANGED
@@ -1,76 +1,131 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- childprocess (0.3.6)
5
- ffi (~> 1.0, >= 1.0.6)
6
- coderay (1.0.8)
7
- diff-lcs (1.1.3)
8
- ffi (1.2.0)
9
- git (1.2.5)
10
- guard (1.5.4)
11
- listen (>= 0.4.2)
12
- lumberjack (>= 1.0.2)
13
- pry (>= 0.9.10)
14
- thor (>= 0.14.6)
15
- guard-bundler (1.0.0)
4
+ addressable (2.3.6)
5
+ builder (3.2.2)
6
+ celluloid (0.16.0)
7
+ timers (~> 4.0.0)
8
+ childprocess (0.5.5)
9
+ ffi (~> 1.0, >= 1.0.11)
10
+ codeclimate-test-reporter (0.4.3)
11
+ simplecov (>= 0.7.1, < 1.0.0)
12
+ coderay (1.1.0)
13
+ descendants_tracker (0.0.4)
14
+ thread_safe (~> 0.3, >= 0.3.1)
15
+ diff-lcs (1.2.5)
16
+ docile (1.1.5)
17
+ faraday (0.9.0)
18
+ multipart-post (>= 1.2, < 3)
19
+ ffi (1.9.6)
20
+ formatador (0.2.5)
21
+ git (1.2.8)
22
+ github_api (0.12.2)
23
+ addressable (~> 2.3)
24
+ descendants_tracker (~> 0.0.4)
25
+ faraday (~> 0.8, < 0.10)
26
+ hashie (>= 3.3)
27
+ multi_json (>= 1.7.5, < 2.0)
28
+ nokogiri (~> 1.6.3)
29
+ oauth2
30
+ guard (2.8.2)
31
+ formatador (>= 0.2.4)
32
+ listen (~> 2.7)
33
+ lumberjack (~> 1.0)
34
+ pry (>= 0.9.12)
35
+ thor (>= 0.18.1)
36
+ guard-bundler (2.0.0)
16
37
  bundler (~> 1.0)
17
- guard (~> 1.1)
18
- guard-rspec (2.3.1)
19
- guard (>= 1.1)
20
- rspec (~> 2.11)
21
- guard-spork (1.4.0)
38
+ guard (~> 2.2)
39
+ guard-rspec (4.3.1)
40
+ guard (~> 2.1)
41
+ rspec (>= 2.14, < 4.0)
42
+ guard-spork (2.0.2)
22
43
  childprocess (>= 0.2.3)
23
- guard (>= 1.1)
44
+ guard (~> 2.0, <= 2.9.0)
24
45
  spork (>= 0.8.4)
25
- jeweler (1.8.4)
26
- bundler (~> 1.0)
46
+ hashie (3.3.2)
47
+ highline (1.6.21)
48
+ hitimes (1.2.2)
49
+ jeweler (2.0.1)
50
+ builder
51
+ bundler (>= 1.0)
27
52
  git (>= 1.2.5)
53
+ github_api
54
+ highline (>= 1.6.15)
55
+ nokogiri (>= 1.5.10)
28
56
  rake
29
57
  rdoc
30
- json (1.7.5)
31
- libnotify (0.8.0)
58
+ json (1.8.1)
59
+ jwt (1.2.0)
60
+ libnotify (0.8.4)
32
61
  ffi (>= 1.0.11)
33
- listen (0.6.0)
34
- lumberjack (1.0.2)
35
- method_source (0.8.1)
36
- multi_json (1.5.0)
37
- pry (0.9.10)
38
- coderay (~> 1.0.5)
39
- method_source (~> 0.8)
40
- slop (~> 3.3.1)
41
- rake (10.0.3)
42
- rb-inotify (0.8.8)
62
+ listen (2.8.3)
63
+ celluloid (>= 0.15.2)
64
+ rb-fsevent (>= 0.9.3)
65
+ rb-inotify (>= 0.9)
66
+ lumberjack (1.0.9)
67
+ method_source (0.8.2)
68
+ mini_portile (0.6.1)
69
+ multi_json (1.10.1)
70
+ multi_xml (0.5.5)
71
+ multipart-post (2.0.0)
72
+ nokogiri (1.6.5)
73
+ mini_portile (~> 0.6.0)
74
+ oauth2 (1.0.0)
75
+ faraday (>= 0.8, < 0.10)
76
+ jwt (~> 1.0)
77
+ multi_json (~> 1.3)
78
+ multi_xml (~> 0.5)
79
+ rack (~> 1.2)
80
+ pry (0.10.1)
81
+ coderay (~> 1.1.0)
82
+ method_source (~> 0.8.1)
83
+ slop (~> 3.4)
84
+ rack (1.5.2)
85
+ rake (10.4.2)
86
+ rb-fsevent (0.9.4)
87
+ rb-inotify (0.9.5)
43
88
  ffi (>= 0.5.0)
44
- rdoc (3.12)
89
+ rdoc (4.1.2)
45
90
  json (~> 1.4)
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)
52
- diff-lcs (~> 1.1.3)
53
- rspec-mocks (2.12.0)
54
- simplecov (0.7.1)
91
+ rspec (3.1.0)
92
+ rspec-core (~> 3.1.0)
93
+ rspec-expectations (~> 3.1.0)
94
+ rspec-mocks (~> 3.1.0)
95
+ rspec-core (3.1.7)
96
+ rspec-support (~> 3.1.0)
97
+ rspec-expectations (3.1.2)
98
+ diff-lcs (>= 1.2.0, < 2.0)
99
+ rspec-support (~> 3.1.0)
100
+ rspec-mocks (3.1.3)
101
+ rspec-support (~> 3.1.0)
102
+ rspec-support (3.1.2)
103
+ simplecov (0.9.1)
104
+ docile (~> 1.1.0)
55
105
  multi_json (~> 1.0)
56
- simplecov-html (~> 0.7.1)
57
- simplecov-html (0.7.1)
58
- slop (3.3.3)
106
+ simplecov-html (~> 0.8.0)
107
+ simplecov-html (0.8.0)
108
+ slop (3.6.0)
59
109
  spork (0.9.2)
60
- thor (0.16.0)
110
+ thor (0.19.1)
111
+ thread_safe (0.3.4)
112
+ timers (4.0.1)
113
+ hitimes
61
114
 
62
115
  PLATFORMS
63
116
  ruby
64
117
 
65
118
  DEPENDENCIES
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)
119
+ bundler (~> 1.7.0)
120
+ codeclimate-test-reporter (~> 0.4.0)
121
+ guard (~> 2.8.0)
122
+ guard-bundler (~> 2.0.0)
123
+ guard-rspec (~> 4.3.0)
124
+ guard-spork (~> 2.0.0)
125
+ jeweler (~> 2.0.0)
72
126
  libnotify
73
127
  rb-inotify
74
- rdoc (~> 3.12)
75
- rspec (~> 2.0)
76
- simplecov (~> 0.7)
128
+ rdoc (~> 4.1.0)
129
+ rspec (~> 3.1)
130
+ simplecov (~> 0.9.0)
131
+ spork (~> 0.9.0)
data/Guardfile CHANGED
@@ -1,7 +1,3 @@
1
- # ----------------------------------------------------------------------------------------------------------------------
2
- # More info at https://github.com/guard/guard#readme
3
- # ----------------------------------------------------------------------------------------------------------------------
4
-
5
1
 
6
2
  # ----------------------------------------------------------------------------------------------------------------------
7
3
  # bundler
@@ -17,7 +13,7 @@ end
17
13
  # ----------------------------------------------------------------------------------------------------------------------
18
14
 
19
15
  guard 'spork',
20
- :wait => 60 do
16
+ wait: 60 do
21
17
 
22
18
  watch('Gemfile')
23
19
  watch('Gemfile.lock')
@@ -31,10 +27,7 @@ end
31
27
  # rspec
32
28
  # ----------------------------------------------------------------------------------------------------------------------
33
29
 
34
- guard 'rspec',
35
- :all_after_pass => false,
36
- :all_on_start => false,
37
- :cli => '--colour --drb --format documentation --tag focused' do
30
+ guard :rspec, cmd: 'bundle exec rspec' do
38
31
 
39
32
  # ----- lib directory
40
33
  watch(%r{^lib/(.+)\.rb$}) { |m| %W(spec/#{m[1]}_spec.rb) }
data/LICENSE.txt CHANGED
@@ -14,7 +14,7 @@ included in all copies or substantial portions of the Software.
14
14
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17
+ NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,37 +1,45 @@
1
- # NDD-RSpec
1
+ # NDD RSpec
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/ddidier/ndd-rspec.png)](http://travis-ci.org/ddidier/ndd-rspec)
4
4
  [![Dependency Status](https://gemnasium.com/ddidier/ndd-rspec.png)](https://gemnasium.com/ddidier/ndd-rspec)
5
+ [![Code Climate](https://codeclimate.com/github/ddidier/ndd-rspec/badges/gpa.svg)](https://codeclimate.com/github/ddidier/ndd-rspec)
6
+ [![Test Coverage](https://codeclimate.com/github/ddidier/ndd-rspec/badges/coverage.svg)](https://codeclimate.com/github/ddidier/ndd-rspec)
5
7
 
6
8
  RSpec utilities.
7
9
 
10
+ ## Prerequisites
11
+
12
+ This gem requires RSpec 3.1 and is tested with:
13
+
14
+ - Ruby 1.9.3
15
+ - Ruby 2.0.0
16
+ - Ruby 2.1.x
17
+
8
18
  ## Matchers
9
19
 
10
20
  ### be\_sorted\_by
11
21
 
12
22
  ```ruby
13
- [1, 2, 3].should be_sorted_by(:to_i) # => true
14
- [1, 3, 2].should be_sorted_by(:to_i) # => false
23
+ expect([1, 2, 3]).to be_sorted_by(:to_i) # => true
24
+ expect([1, 3, 2]).to be_sorted_by(:to_i) # => false
25
+
26
+ Duck = Struct.new(:color)
27
+ expect([Duck.new('Grey'), Duck.new('White')]).to be_sorted_by(:color) } # => true
28
+ expect([Duck.new('White'), Duck.new('Grey')]).to be_sorted_by(:color) } # => false
15
29
  ```
16
30
 
17
31
  ### be\_reverse\_sorted\_by
18
32
 
19
33
  ```ruby
20
- [3, 2, 1].should be_reverse_sorted_by(:to_i) # => true
21
- [1, 3, 2].should be_reverse_sorted_by(:to_i) # => false
22
- ```
23
-
24
- ## Contributing to ndd-rspec
34
+ expect([3, 2, 1]).to be_reverse_sorted_by(:to_i) # => true
35
+ expect([1, 3, 2]).to be_reverse_sorted_by(:to_i) # => false
25
36
 
26
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
27
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
28
- * Fork the project.
29
- * Start a feature/bugfix branch.
30
- * Commit and push until you are happy with your contribution.
31
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
32
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version,
33
- or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
37
+ Duck = Struct.new(:color)
38
+ expect([Duck.new('White'), Duck.new('Grey')]).to be_reverse_sorted_by(:color) } # => true
39
+ expect([Duck.new('Grey'), Duck.new('White')]).to be_reverse_sorted_by(:color) } # => false
40
+ ```
34
41
 
35
42
  ## Copyright
36
43
 
37
- Copyright (c) 2012 David DIDIER. See LICENSE.txt for further details.
44
+ Copyright (c) 2014 David DIDIER.
45
+ See `LICENSE.txt` for further details.
data/Rakefile CHANGED
@@ -6,21 +6,22 @@ begin
6
6
  Bundler.setup(:default, :development)
7
7
  rescue Bundler::BundlerError => e
8
8
  $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
9
+ $stderr.puts 'Run `bundle install` to install missing gems'
10
10
  exit e.status_code
11
11
  end
12
12
  require 'rake'
13
13
 
14
14
  require 'jeweler'
15
15
  Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "ndd-rspec"
18
- gem.homepage = "http://github.com/ddidier/ndd-rspec"
19
- gem.license = "MIT"
20
- gem.summary = %Q{RSpec utilities}
21
- gem.description = %Q{RSpec utilities}
22
- gem.email = "c_inconnu2@yahoo.fr"
23
- gem.authors = ["David DIDIER"]
16
+ # gem is a Gem::Specification...
17
+ # see http://guides.rubygems.org/specification-reference/ for more options
18
+ gem.name = 'ndd-rspec'
19
+ gem.homepage = 'http://github.com/ddidier/ndd-rspec'
20
+ gem.license = 'MIT'
21
+ gem.summary = 'RSpec utilities'
22
+ gem.description = 'RSpec utilities'
23
+ gem.email = 'c_inconnu2@yahoo.fr'
24
+ gem.authors = ['David DIDIER']
24
25
  # dependencies defined in Gemfile
25
26
  end
26
27
  Jeweler::RubygemsDotOrgTasks.new
@@ -31,9 +32,10 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
31
32
  spec.pattern = FileList['spec/**/*_spec.rb']
32
33
  end
33
34
 
34
- RSpec::Core::RakeTask.new(:rcov) do |spec|
35
- spec.pattern = 'spec/**/*_spec.rb'
36
- spec.rcov = true
35
+ desc 'Code coverage detail'
36
+ task :simplecov do
37
+ ENV['COVERAGE'] = 'true'
38
+ Rake::Task['spec'].execute
37
39
  end
38
40
 
39
41
  task :default => :spec
@@ -43,7 +45,7 @@ Rake::RDocTask.new do |rdoc|
43
45
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
46
 
45
47
  rdoc.rdoc_dir = 'rdoc'
46
- rdoc.title = "address_picker-rails #{version}"
48
+ rdoc.title = "NDD RSpec #{version}"
47
49
  rdoc.rdoc_files.include('README*')
48
50
  rdoc.rdoc_files.include('lib/**/*.rb')
49
51
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 1.0.0
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'rspec/expectations'
3
- require 'rspec/expectations/differ'
3
+ # require 'rspec/expectations/differ'
4
4
 
5
5
 
6
6
  module Ndd
@@ -12,10 +12,12 @@ module Ndd
12
12
  end
13
13
 
14
14
  # ----------------------------------------------------------------------------------------------------------------
15
- # Ensures that an enumerable (responding to <code>Enumerable#collect</code>) is sorted by the given attribute in reverse order
15
+ # Ensures that an enumerable (responding to <code>Enumerable#collect</code>) is sorted in reverse order by the
16
+ # given attribute of the objects it contains.
16
17
  #
17
18
  # Examples:
18
- # [MyObject.new(my_attribute: 2), MyObject.new(my_attribute: 1)].should be_reverse_sorted_by(:my_attribute) }
19
+ # Duck = Struct.new(:color)
20
+ # [Duck.new('White'), Duck.new('Grey')].should be_sorted_by(:color) }
19
21
  #
20
22
  class BeReverseSortedBy
21
23
 
@@ -35,7 +37,7 @@ module Ndd
35
37
  "be sorted by '#@attribute' in reverse order"
36
38
  end
37
39
 
38
- def failure_message_for_should
40
+ def failure_message
39
41
  return <<-MESSAGE
40
42
 
41
43
  expected '#{@actual.inspect}' to be sorted by '#@attribute' in reverse order
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'rspec/expectations'
3
- require 'rspec/expectations/differ'
3
+ # require 'rspec/expectations/differ'
4
4
 
5
5
 
6
6
  module Ndd
@@ -12,10 +12,12 @@ module Ndd
12
12
  end
13
13
 
14
14
  # ----------------------------------------------------------------------------------------------------------------
15
- # Ensures that an enumerable (responding to <code>Enumerable#collect</code>) is sorted by the given attribute.
15
+ # Ensures that an enumerable (responding to <code>Enumerable#collect</code>) is sorted by the given attribute of
16
+ # the objects it contains.
16
17
  #
17
18
  # Examples:
18
- # [MyObject.new(my_attribute: 1), MyObject.new(my_attribute: 2)].should be_sorted_by(:my_attribute) }
19
+ # Duck = Struct.new(:color)
20
+ # [Duck.new('Grey'), Duck.new('White')].should be_sorted_by(:color) }
19
21
  #
20
22
  class BeSortedBy
21
23
 
@@ -35,7 +37,7 @@ module Ndd
35
37
  "be sorted by '#@attribute'"
36
38
  end
37
39
 
38
- def failure_message_for_should
40
+ def failure_message
39
41
  return <<-MESSAGE
40
42
 
41
43
  expected '#{@actual.inspect}' to be sorted by '#@attribute'
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
- require_relative 'matchers/be_reverse_sorted_by'
3
- require_relative 'matchers/be_sorted_by'
2
+ require 'ndd/rspec/matchers/be_reverse_sorted_by'
3
+ require 'ndd/rspec/matchers/be_sorted_by'
4
4
 
5
5
 
6
6
  module RSpec::Matchers
data/ndd-rspec.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: ndd-rspec 1.0.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "ndd-rspec"
8
- s.version = "0.1.1"
9
+ s.version = "1.0.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["David DIDIER"]
12
- s.date = "2012-12-13"
14
+ s.date = "2014-12-08"
13
15
  s.description = "RSpec utilities"
14
16
  s.email = "c_inconnu2@yahoo.fr"
15
17
  s.extra_rdoc_files = [
@@ -18,6 +20,8 @@ Gem::Specification.new do |s|
18
20
  ]
19
21
  s.files = [
20
22
  ".document",
23
+ ".ruby-gemset",
24
+ ".ruby-version",
21
25
  ".travis.yml",
22
26
  "CHANGELOG.md",
23
27
  "Gemfile",
@@ -38,48 +42,50 @@ Gem::Specification.new do |s|
38
42
  ]
39
43
  s.homepage = "http://github.com/ddidier/ndd-rspec"
40
44
  s.licenses = ["MIT"]
41
- s.require_paths = ["lib"]
42
- s.rubygems_version = "1.8.24"
45
+ s.rubygems_version = "2.4.4"
43
46
  s.summary = "RSpec utilities"
44
47
 
45
48
  if s.respond_to? :specification_version then
46
- s.specification_version = 3
49
+ s.specification_version = 4
47
50
 
48
51
  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"])
52
+ s.add_runtime_dependency(%q<rspec>, ["~> 3.1"])
53
+ s.add_development_dependency(%q<bundler>, ["~> 1.7.0"])
54
+ s.add_development_dependency(%q<guard>, ["~> 2.8.0"])
55
+ s.add_development_dependency(%q<guard-bundler>, ["~> 2.0.0"])
56
+ s.add_development_dependency(%q<guard-rspec>, ["~> 4.3.0"])
57
+ s.add_development_dependency(%q<guard-spork>, ["~> 2.0.0"])
58
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.0"])
59
+ s.add_development_dependency(%q<rdoc>, ["~> 4.1.0"])
60
+ s.add_development_dependency(%q<simplecov>, ["~> 0.9.0"])
61
+ s.add_development_dependency(%q<spork>, ["~> 0.9.0"])
58
62
  s.add_development_dependency(%q<libnotify>, [">= 0"])
59
63
  s.add_development_dependency(%q<rb-inotify>, [">= 0"])
60
64
  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"])
65
+ s.add_dependency(%q<rspec>, ["~> 3.1"])
66
+ s.add_dependency(%q<bundler>, ["~> 1.7.0"])
67
+ s.add_dependency(%q<guard>, ["~> 2.8.0"])
68
+ s.add_dependency(%q<guard-bundler>, ["~> 2.0.0"])
69
+ s.add_dependency(%q<guard-rspec>, ["~> 4.3.0"])
70
+ s.add_dependency(%q<guard-spork>, ["~> 2.0.0"])
71
+ s.add_dependency(%q<jeweler>, ["~> 2.0.0"])
72
+ s.add_dependency(%q<rdoc>, ["~> 4.1.0"])
73
+ s.add_dependency(%q<simplecov>, ["~> 0.9.0"])
74
+ s.add_dependency(%q<spork>, ["~> 0.9.0"])
70
75
  s.add_dependency(%q<libnotify>, [">= 0"])
71
76
  s.add_dependency(%q<rb-inotify>, [">= 0"])
72
77
  end
73
78
  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"])
79
+ s.add_dependency(%q<rspec>, ["~> 3.1"])
80
+ s.add_dependency(%q<bundler>, ["~> 1.7.0"])
81
+ s.add_dependency(%q<guard>, ["~> 2.8.0"])
82
+ s.add_dependency(%q<guard-bundler>, ["~> 2.0.0"])
83
+ s.add_dependency(%q<guard-rspec>, ["~> 4.3.0"])
84
+ s.add_dependency(%q<guard-spork>, ["~> 2.0.0"])
85
+ s.add_dependency(%q<jeweler>, ["~> 2.0.0"])
86
+ s.add_dependency(%q<rdoc>, ["~> 4.1.0"])
87
+ s.add_dependency(%q<simplecov>, ["~> 0.9.0"])
88
+ s.add_dependency(%q<spork>, ["~> 0.9.0"])
83
89
  s.add_dependency(%q<libnotify>, [">= 0"])
84
90
  s.add_dependency(%q<rb-inotify>, [">= 0"])
85
91
  end
@@ -4,36 +4,36 @@ require 'ndd/rspec/matchers'
4
4
  require 'ndd/rspec/matchers/shared_examples'
5
5
 
6
6
 
7
- describe "be reverse sorted by", { :type => 'matcher' } do
7
+ describe 'be reverse sorted by', { :type => 'matcher' } do
8
8
 
9
9
  REVERSE_SORTED_ARRAY = [3, 2, 1].freeze
10
- UNSORTED_ARRAY = [1, 3, 2].freeze
10
+ REVERSE_UNSORTED_ARRAY = [1, 3, 2].freeze
11
11
 
12
- it_behaves_like "an RSpec matcher",
12
+ it_behaves_like 'an RSpec matcher',
13
13
  :valid_value => REVERSE_SORTED_ARRAY,
14
- :invalid_value => UNSORTED_ARRAY do
14
+ :invalid_value => REVERSE_UNSORTED_ARRAY do
15
15
  let(:matcher) { be_reverse_sorted_by(:to_i) }
16
16
  end
17
17
 
18
- it "matches when actual is sorted according to the given attribute in reverse order" do
19
- REVERSE_SORTED_ARRAY.should be_reverse_sorted_by(:to_i)
18
+ it 'matches when actual is sorted according to the given attribute in reverse order' do
19
+ expect(REVERSE_SORTED_ARRAY).to be_reverse_sorted_by(:to_i)
20
20
  end
21
21
 
22
- it "does not match when actual is not sorted according to the given attribute in reverse order" do
23
- UNSORTED_ARRAY.should_not be_reverse_sorted_by(:to_i)
22
+ it 'does not match when actual is not sorted according to the given attribute in reverse order' do
23
+ expect(REVERSE_UNSORTED_ARRAY).to_not be_reverse_sorted_by(:to_i)
24
24
  end
25
25
 
26
- it "describes itself" do
26
+ it 'describes itself' do
27
27
  matcher = be_reverse_sorted_by(:to_i)
28
28
  matcher.matches?(REVERSE_SORTED_ARRAY)
29
- matcher.description.should == "be sorted by 'to_i' in reverse order"
29
+ expect(matcher.description).to eq("be sorted by 'to_i' in reverse order")
30
30
  end
31
31
 
32
- it "provides message on #failure_message" do
32
+ it 'provides message on #failure_message' do
33
33
  matcher = be_reverse_sorted_by(:to_i)
34
- matcher.matches?(UNSORTED_ARRAY)
34
+ matcher.matches?(REVERSE_UNSORTED_ARRAY)
35
35
 
36
- matcher.failure_message_for_should.should == <<-MESSAGE
36
+ expect(matcher.failure_message).to eq <<-MESSAGE
37
37
 
38
38
  expected '[1, 3, 2]' to be sorted by 'to_i' in reverse order
39
39
  expected attributes: [3, 2, 1]
@@ -4,36 +4,36 @@ require 'ndd/rspec/matchers'
4
4
  require 'ndd/rspec/matchers/shared_examples'
5
5
 
6
6
 
7
- describe "be sorted by", { :type => 'matcher' } do
7
+ describe 'be sorted by', { :type => 'matcher' } do
8
8
 
9
9
  SORTED_ARRAY = [1, 2, 3].freeze
10
10
  UNSORTED_ARRAY = [1, 3, 2].freeze
11
11
 
12
- it_behaves_like "an RSpec matcher",
12
+ it_behaves_like 'an RSpec matcher',
13
13
  :valid_value => SORTED_ARRAY,
14
14
  :invalid_value => UNSORTED_ARRAY do
15
15
  let(:matcher) { be_sorted_by(:to_i) }
16
16
  end
17
17
 
18
- it "matches when actual is sorted according to the given attribute" do
19
- SORTED_ARRAY.should be_sorted_by(:to_i)
18
+ it 'matches when actual is sorted according to the given attribute' do
19
+ expect(SORTED_ARRAY).to be_sorted_by(:to_i)
20
20
  end
21
21
 
22
- it "does not match when actual is not sorted according to the given attribute" do
23
- UNSORTED_ARRAY.should_not be_sorted_by(:to_i)
22
+ it 'does not match when actual is not sorted according to the given attribute' do
23
+ expect(UNSORTED_ARRAY).to_not be_sorted_by(:to_i)
24
24
  end
25
25
 
26
- it "describes itself" do
26
+ it 'describes itself' do
27
27
  matcher = be_sorted_by(:to_i)
28
28
  matcher.matches?(SORTED_ARRAY)
29
- matcher.description.should == "be sorted by 'to_i'"
29
+ expect(matcher.description).to eq("be sorted by 'to_i'")
30
30
  end
31
31
 
32
- it "provides message on #failure_message" do
32
+ it 'provides message on #failure_message' do
33
33
  matcher = be_sorted_by(:to_i)
34
34
  matcher.matches?(UNSORTED_ARRAY)
35
35
 
36
- matcher.failure_message_for_should.should == <<-MESSAGE
36
+ expect(matcher.failure_message).to eq <<-MESSAGE
37
37
 
38
38
  expected '[1, 3, 2]' to be sorted by 'to_i'
39
39
  expected attributes: [1, 2, 3]
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'spec_helper'
3
3
 
4
- shared_examples_for "an RSpec matcher" do |options|
4
+ shared_examples_for 'an RSpec matcher' do |options|
5
5
 
6
6
  let(:valid_value) { options.fetch(:valid_value) }
7
7
  let(:invalid_value) { options.fetch(:invalid_value) }
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  # encoding: utf-8
2
+ require 'codeclimate-test-reporter'
3
+ CodeClimate::TestReporter.start
4
+
2
5
  require 'rubygems'
3
6
  require 'spork'
4
7
 
@@ -9,13 +12,21 @@ require 'spork'
9
12
  # configuration or code from libraries loaded here, you'll need to restart spork for it take effect.
10
13
  # ----------------------------------------------------------------------------------------------------------------------
11
14
 
15
+ lib_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
16
+ spec_dir = File.dirname(__FILE__)
17
+
12
18
  Spork.prefork do
13
19
 
20
+ # ----- load path
21
+
22
+ $LOAD_PATH.unshift(lib_path)
23
+ $LOAD_PATH.unshift(spec_dir)
24
+
14
25
  # ----- code coverage
15
26
 
16
- if ENV["COVERAGE"] and not ENV['DRB']
27
+ if ENV['COVERAGE'] and not ENV['DRB']
17
28
  require 'simplecov'
18
- SimpleCov.start
29
+ SimpleCov.start 'test_frameworks'
19
30
  end
20
31
 
21
32
  # ----- requirements
@@ -23,7 +34,6 @@ Spork.prefork do
23
34
  require 'rspec'
24
35
  require 'ndd/rspec/matchers'
25
36
 
26
-
27
37
  # ----- RSpec configuration
28
38
 
29
39
  RSpec.configure do |config|
@@ -31,14 +41,15 @@ Spork.prefork do
31
41
  config.mock_with :rspec
32
42
 
33
43
  # ----- filters
34
- config.treat_symbols_as_metadata_keys_with_true_values = true
35
44
  config.alias_example_to :fit, :focused
36
- config.fail_fast = false
37
- config.filter_run :focused
45
+ config.filter_run_including :focused
46
+ config.order = 'random'
38
47
  config.run_all_when_everything_filtered = true
48
+ config.expect_with :rspec do |c|
49
+ c.syntax = :expect
50
+ end
39
51
 
40
52
  # ----- libraries
41
- # Ndd-RSpec
42
53
  config.include Ndd::RSpec::Matchers, :type => :matcher
43
54
  end
44
55
 
@@ -54,15 +65,14 @@ Spork.each_run do
54
65
 
55
66
  # ----- code coverage
56
67
 
57
- if ENV["COVERAGE"] and not ENV['DRB']
58
- require 'simplecov'
59
- SimpleCov.start
60
- end
68
+ # if ENV['COVERAGE'] and not ENV['DRB']
69
+ # require 'simplecov'
70
+ # SimpleCov.start 'test_frameworks'
71
+ # end
61
72
 
62
73
  # ----- files reload
63
- lib_path = File.expand_path('../../lib', __FILE__)
64
- Dir["#{lib_path}/**/*.rb"].each do |file|
65
- load file
66
- end
74
+ Dir["#{lib_path}/**/*.rb"].each { |file| require file }
75
+ Dir["#{spec_dir}/support/**/*.rb"].each { |file| require file }
67
76
 
77
+ require 'ndd/rspec/matchers'
68
78
  end
metadata CHANGED
@@ -1,190 +1,181 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndd-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 1.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - David DIDIER
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-13 00:00:00.000000000 Z
11
+ date: 2014-12-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '2.0'
19
+ version: '3.1'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '2.0'
26
+ version: '3.1'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: '1.2'
33
+ version: 1.7.0
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
- version: '1.2'
40
+ version: 1.7.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: guard
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '1.0'
47
+ version: 2.8.0
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '1.0'
54
+ version: 2.8.0
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: guard-bundler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
- version: '1.0'
61
+ version: 2.0.0
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
- version: '1.0'
68
+ version: 2.0.0
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: guard-rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
- version: '2.0'
75
+ version: 4.3.0
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
- version: '2.0'
82
+ version: 4.3.0
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: guard-spork
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ~>
87
+ - - "~>"
100
88
  - !ruby/object:Gem::Version
101
- version: '1.0'
89
+ version: 2.0.0
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ~>
94
+ - - "~>"
108
95
  - !ruby/object:Gem::Version
109
- version: '1.0'
96
+ version: 2.0.0
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: jeweler
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ~>
101
+ - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: '1.8'
103
+ version: 2.0.0
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ~>
108
+ - - "~>"
124
109
  - !ruby/object:Gem::Version
125
- version: '1.8'
110
+ version: 2.0.0
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rdoc
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ~>
115
+ - - "~>"
132
116
  - !ruby/object:Gem::Version
133
- version: '3.12'
117
+ version: 4.1.0
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ~>
122
+ - - "~>"
140
123
  - !ruby/object:Gem::Version
141
- version: '3.12'
124
+ version: 4.1.0
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: simplecov
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ~>
129
+ - - "~>"
148
130
  - !ruby/object:Gem::Version
149
- version: '0.7'
131
+ version: 0.9.0
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ~>
136
+ - - "~>"
156
137
  - !ruby/object:Gem::Version
157
- version: '0.7'
138
+ version: 0.9.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: spork
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.9.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.9.0
158
153
  - !ruby/object:Gem::Dependency
159
154
  name: libnotify
160
155
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
156
  requirements:
163
- - - ! '>='
157
+ - - ">="
164
158
  - !ruby/object:Gem::Version
165
159
  version: '0'
166
160
  type: :development
167
161
  prerelease: false
168
162
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
163
  requirements:
171
- - - ! '>='
164
+ - - ">="
172
165
  - !ruby/object:Gem::Version
173
166
  version: '0'
174
167
  - !ruby/object:Gem::Dependency
175
168
  name: rb-inotify
176
169
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
170
  requirements:
179
- - - ! '>='
171
+ - - ">="
180
172
  - !ruby/object:Gem::Version
181
173
  version: '0'
182
174
  type: :development
183
175
  prerelease: false
184
176
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
177
  requirements:
187
- - - ! '>='
178
+ - - ">="
188
179
  - !ruby/object:Gem::Version
189
180
  version: '0'
190
181
  description: RSpec utilities
@@ -195,8 +186,10 @@ extra_rdoc_files:
195
186
  - LICENSE.txt
196
187
  - README.md
197
188
  files:
198
- - .document
199
- - .travis.yml
189
+ - ".document"
190
+ - ".ruby-gemset"
191
+ - ".ruby-version"
192
+ - ".travis.yml"
200
193
  - CHANGELOG.md
201
194
  - Gemfile
202
195
  - Gemfile.lock
@@ -216,29 +209,25 @@ files:
216
209
  homepage: http://github.com/ddidier/ndd-rspec
217
210
  licenses:
218
211
  - MIT
212
+ metadata: {}
219
213
  post_install_message:
220
214
  rdoc_options: []
221
215
  require_paths:
222
216
  - lib
223
217
  required_ruby_version: !ruby/object:Gem::Requirement
224
- none: false
225
218
  requirements:
226
- - - ! '>='
219
+ - - ">="
227
220
  - !ruby/object:Gem::Version
228
221
  version: '0'
229
- segments:
230
- - 0
231
- hash: 3372791830405890157
232
222
  required_rubygems_version: !ruby/object:Gem::Requirement
233
- none: false
234
223
  requirements:
235
- - - ! '>='
224
+ - - ">="
236
225
  - !ruby/object:Gem::Version
237
226
  version: '0'
238
227
  requirements: []
239
228
  rubyforge_project:
240
- rubygems_version: 1.8.24
229
+ rubygems_version: 2.4.4
241
230
  signing_key:
242
- specification_version: 3
231
+ specification_version: 4
243
232
  summary: RSpec utilities
244
233
  test_files: []