specstar-controllers 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/specstar/controllers.rb +15 -3
- metadata +2 -2
data/lib/specstar/controllers.rb
CHANGED
@@ -5,15 +5,27 @@ module Specstar
|
|
5
5
|
module Matchers
|
6
6
|
RSpec::Matchers.define :have_layout do |expected|
|
7
7
|
match do |controller|
|
8
|
-
|
8
|
+
if expected
|
9
|
+
expected.to_s == controller.class.instance_variable_get("@_layout")
|
10
|
+
else
|
11
|
+
controller.class.instance_variable_get("@_layout")
|
12
|
+
end
|
9
13
|
end
|
10
14
|
|
11
15
|
failure_message_for_should do |controller|
|
12
|
-
|
16
|
+
if expected
|
17
|
+
"Expected #{controller.class.name} to have layout '#{expected}'."
|
18
|
+
else
|
19
|
+
"Expected #{controller.class.name} to have layout."
|
20
|
+
end
|
13
21
|
end
|
14
22
|
|
15
23
|
failure_message_for_should_not do |controller|
|
16
|
-
|
24
|
+
if expected
|
25
|
+
"Expected #{controller.class.name} not to have layout '#{expected}'."
|
26
|
+
else
|
27
|
+
"Expected #{controller.class.name} not to have layout."
|
28
|
+
end
|
17
29
|
end
|
18
30
|
end
|
19
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specstar-controllers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
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: 2013-
|
12
|
+
date: 2013-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec-core
|