mark_facets 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,28 @@
|
|
1
1
|
if Rails.v3?
|
2
2
|
|
3
|
+
def have_same_elements(expected)
|
4
|
+
Rspec::Matchers::Matcher.new :have_same_elements, expected do
|
5
|
+
match do |actual|
|
6
|
+
# matcher.failure_message = "expected #{given.inspect} to include the same elements as #{expected.inspect}"
|
7
|
+
# matcher.negative_failure_message = "expected #{given.inspect} not to include the same elements as #{expected.inspect}"
|
8
|
+
unless actual.size == expected.size
|
9
|
+
false
|
10
|
+
else
|
11
|
+
ret = true
|
12
|
+
actual.each do |v|
|
13
|
+
ret = expected.include?(v)
|
14
|
+
break if !ret
|
15
|
+
end
|
16
|
+
ret
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
3
22
|
end
|
4
23
|
|
5
24
|
if Rails.v2?
|
25
|
+
|
6
26
|
def have_same_elements(expected)
|
7
27
|
simple_matcher("equal #{expected.inspect}") do |given, matcher|
|
8
28
|
matcher.failure_message = "expected #{given.inspect} to include the same elements as #{expected.inspect}"
|
@@ -19,4 +39,5 @@ if Rails.v2?
|
|
19
39
|
end
|
20
40
|
end
|
21
41
|
end
|
42
|
+
|
22
43
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mark_facets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- markbates
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-20 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|