set_specs 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/set_specs.rb +4 -4
- metadata +28 -13
data/lib/set_specs.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
RSpec::Matchers.define :intersect_with do |challenge_range|
|
2
2
|
|
3
3
|
#based on http://gist.github.com/247669, but using Enumerable#select rather than '&', for compatibility with all enumerables (Enumerable doesn't implement &).
|
4
4
|
|
@@ -20,7 +20,7 @@ Spec::Matchers.define :intersect_with do |challenge_range|
|
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
RSpec::Matchers.define :be_a_subset_of do |challenge_range|
|
24
24
|
|
25
25
|
|
26
26
|
match do |current_range|
|
@@ -42,7 +42,7 @@ Spec::Matchers.define :be_a_subset_of do |challenge_range|
|
|
42
42
|
end
|
43
43
|
|
44
44
|
|
45
|
-
|
45
|
+
RSpec::Matchers.define :be_a_proper_subset_of do |challenge_range|
|
46
46
|
|
47
47
|
|
48
48
|
match do |current_range|
|
@@ -64,7 +64,7 @@ Spec::Matchers.define :be_a_proper_subset_of do |challenge_range|
|
|
64
64
|
end
|
65
65
|
|
66
66
|
|
67
|
-
|
67
|
+
RSpec::Matchers.define :partition do |partitioned_set|
|
68
68
|
match do |partitioning_sets|
|
69
69
|
entries = partitioning_sets.map {|s| s.entries}
|
70
70
|
entries.zip(entries[1..-1]).map {|a1,a2| a1.should_not intersect_with(a2 || []) }.inject(true) {|m, n| m && n }
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: set_specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Tim Cowlishaw
|
@@ -9,29 +14,35 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-07-04 00:00:00 +01:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rspec
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
23
30
|
version: "0"
|
24
|
-
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
25
33
|
- !ruby/object:Gem::Dependency
|
26
34
|
name: rspec
|
27
|
-
|
28
|
-
|
29
|
-
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
33
43
|
version: "0"
|
34
|
-
|
44
|
+
type: :development
|
45
|
+
version_requirements: *id002
|
35
46
|
description:
|
36
47
|
email: tim@timcowlishaw.co.uk
|
37
48
|
executables: []
|
@@ -54,21 +65,25 @@ rdoc_options:
|
|
54
65
|
require_paths:
|
55
66
|
- lib
|
56
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
57
69
|
requirements:
|
58
70
|
- - ">="
|
59
71
|
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
60
74
|
version: "0"
|
61
|
-
version:
|
62
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
63
77
|
requirements:
|
64
78
|
- - ">="
|
65
79
|
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
66
82
|
version: "0"
|
67
|
-
version:
|
68
83
|
requirements: []
|
69
84
|
|
70
85
|
rubyforge_project: set_specs
|
71
|
-
rubygems_version: 1.3.
|
86
|
+
rubygems_version: 1.3.7
|
72
87
|
signing_key:
|
73
88
|
specification_version: 3
|
74
89
|
summary: A few Rspec matchers for making assertions about set-like properties of Enumerables.
|