set_specs 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/set_specs.rb +5 -5
- metadata +5 -5
data/lib/set_specs.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'spec'
|
2
2
|
|
3
|
-
|
3
|
+
Spec::Matchers.define :intersect_with do |challenge_range|
|
4
4
|
|
5
5
|
#based on http://gist.github.com/247669, but using Enumerable#select rather than '&', for compatibility with all enumerables (Enumerable doesn't implement &).
|
6
6
|
|
@@ -22,7 +22,7 @@ RSpec::Matchers.define :intersect_with do |challenge_range|
|
|
22
22
|
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
Spec::Matchers.define :be_a_subset_of do |challenge_range|
|
26
26
|
|
27
27
|
|
28
28
|
match do |current_range|
|
@@ -44,7 +44,7 @@ RSpec::Matchers.define :be_a_subset_of do |challenge_range|
|
|
44
44
|
end
|
45
45
|
|
46
46
|
|
47
|
-
|
47
|
+
Spec::Matchers.define :be_a_proper_subset_of do |challenge_range|
|
48
48
|
|
49
49
|
|
50
50
|
match do |current_range|
|
@@ -66,7 +66,7 @@ RSpec::Matchers.define :be_a_proper_subset_of do |challenge_range|
|
|
66
66
|
end
|
67
67
|
|
68
68
|
|
69
|
-
|
69
|
+
Spec::Matchers.define :partition do |partitioned_set|
|
70
70
|
match do |partitioning_sets|
|
71
71
|
entries = partitioning_sets.map {|s| s.entries}
|
72
72
|
entries.zip(entries[1..-1]).map {|a1,a2| a1.should_not intersect_with(a2 || []) }.inject(true) {|m, n| m && n }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: set_specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tim Cowlishaw
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-28 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -57,7 +57,7 @@ extra_rdoc_files:
|
|
57
57
|
files:
|
58
58
|
- README
|
59
59
|
- lib/set_specs.rb
|
60
|
-
has_rdoc:
|
60
|
+
has_rdoc: false
|
61
61
|
homepage: http://github.com/timcowlishaw/set_specs/
|
62
62
|
licenses: []
|
63
63
|
|