shoulda-let 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/Gemfile.lock +14 -14
- data/Readme.md +6 -1
- data/gemfiles/shoulda2.gemfile +1 -1
- data/gemfiles/shoulda2.gemfile.lock +2 -2
- data/gemfiles/shoulda3.gemfile +1 -1
- data/gemfiles/shoulda3.gemfile.lock +2 -2
- data/lib/shoulda/let/context_support.rb +2 -4
- data/lib/shoulda/let/test_case_support.rb +2 -5
- data/shoulda-let.gemspec +1 -1
- data/test/shoulda_let_test.rb +11 -0
- metadata +13 -13
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
shoulda-let (0.0.
|
|
4
|
+
shoulda-let (0.0.5)
|
|
5
5
|
shoulda
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
|
-
remote:
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activesupport (3.2.
|
|
11
|
-
i18n (
|
|
10
|
+
activesupport (3.2.13)
|
|
11
|
+
i18n (= 0.6.1)
|
|
12
12
|
multi_json (~> 1.0)
|
|
13
13
|
appraisal (0.5.1)
|
|
14
14
|
bundler
|
|
15
15
|
rake
|
|
16
|
-
bourne (1.
|
|
17
|
-
mocha (
|
|
16
|
+
bourne (1.4.0)
|
|
17
|
+
mocha (~> 0.13.2)
|
|
18
18
|
bump (0.3.7)
|
|
19
19
|
i18n (0.6.1)
|
|
20
20
|
metaclass (0.0.1)
|
|
21
|
-
mocha (0.
|
|
21
|
+
mocha (0.13.3)
|
|
22
22
|
metaclass (~> 0.0.1)
|
|
23
|
-
multi_json (1.
|
|
23
|
+
multi_json (1.7.3)
|
|
24
24
|
rake (10.0.2)
|
|
25
|
-
shoulda (3.
|
|
26
|
-
shoulda-context (~> 1.0.1)
|
|
27
|
-
shoulda-matchers (~> 1.4.1)
|
|
28
|
-
shoulda-context (1.
|
|
29
|
-
shoulda-matchers (1.
|
|
25
|
+
shoulda (3.4.0)
|
|
26
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
|
27
|
+
shoulda-matchers (~> 1.0, >= 1.4.1)
|
|
28
|
+
shoulda-context (1.1.1)
|
|
29
|
+
shoulda-matchers (1.5.6)
|
|
30
30
|
activesupport (>= 3.0.0)
|
|
31
|
-
bourne (~> 1.
|
|
31
|
+
bourne (~> 1.3)
|
|
32
32
|
test-unit (2.5.3)
|
|
33
33
|
|
|
34
34
|
PLATFORMS
|
data/Readme.md
CHANGED
|
@@ -85,7 +85,12 @@ Usage
|
|
|
85
85
|
<!-- example -->
|
|
86
86
|
Author
|
|
87
87
|
======
|
|
88
|
+
|
|
89
|
+
### [Contributors](https://github.com/grosser/shoulda-let/contributors)
|
|
90
|
+
- [James Rosen](https://github.com/jamesarosen)
|
|
91
|
+
- [Steven Davidovitz](https://github.com/steved555)
|
|
92
|
+
|
|
88
93
|
[Michael Grosser](http://grosser.it)<br/>
|
|
89
94
|
michael@grosser.it<br/>
|
|
90
95
|
License: MIT<br/>
|
|
91
|
-
[](http://travis-ci.org/grosser/shoulda-let)
|
data/gemfiles/shoulda2.gemfile
CHANGED
data/gemfiles/shoulda3.gemfile
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
module Shoulda
|
|
2
2
|
module Let
|
|
3
|
-
|
|
4
3
|
module ContextSupport
|
|
5
4
|
# setup method used outside of should blocks
|
|
6
5
|
# let(:foo){ "Foo" }
|
|
@@ -21,10 +20,9 @@ module Shoulda
|
|
|
21
20
|
|
|
22
21
|
def let_defined?(name)
|
|
23
22
|
name = name.to_sym
|
|
24
|
-
( @let
|
|
25
|
-
|
|
23
|
+
( @let and @let.has_key?(name) ) ||
|
|
24
|
+
( parent.respond_to?(:let_defined?) and parent.let_defined?(name) )
|
|
26
25
|
end
|
|
27
26
|
end
|
|
28
|
-
|
|
29
27
|
end
|
|
30
28
|
end
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
module Shoulda
|
|
2
2
|
module Let
|
|
3
|
-
|
|
4
3
|
module TestCaseSupport
|
|
5
4
|
# instance method used inside of should block
|
|
6
5
|
# assert_equal @result, let(:foo)
|
|
@@ -11,7 +10,7 @@ module Shoulda
|
|
|
11
10
|
|
|
12
11
|
def method_missing(name, *arguments, &block)
|
|
13
12
|
name = name.to_sym
|
|
14
|
-
if arguments.length == 0 && block
|
|
13
|
+
if @shoulda_context && arguments.length == 0 && !block && @shoulda_context.let_defined?(name)
|
|
15
14
|
let(name)
|
|
16
15
|
else
|
|
17
16
|
super
|
|
@@ -19,10 +18,8 @@ module Shoulda
|
|
|
19
18
|
end
|
|
20
19
|
|
|
21
20
|
def respond_to?(name, *arguments, &block)
|
|
22
|
-
( @shoulda_context
|
|
21
|
+
( @shoulda_context and @shoulda_context.let_defined?(name) ) or super
|
|
23
22
|
end
|
|
24
|
-
|
|
25
23
|
end
|
|
26
|
-
|
|
27
24
|
end
|
|
28
25
|
end
|
data/shoulda-let.gemspec
CHANGED
data/test/shoulda_let_test.rb
CHANGED
|
@@ -7,4 +7,15 @@ class ShouldaLetTest < Test::Unit::TestCase
|
|
|
7
7
|
example = File.read(File.expand_path("../../Readme.md", __FILE__)).match(/<!-- example -->(.*)<!-- example -->/m)[1]
|
|
8
8
|
eval example
|
|
9
9
|
end
|
|
10
|
+
|
|
11
|
+
should "pass through to regular Test::Unit::TestCase method_missing" do
|
|
12
|
+
begin
|
|
13
|
+
undefined_let
|
|
14
|
+
rescue NoMethodError
|
|
15
|
+
flunk
|
|
16
|
+
rescue NameError
|
|
17
|
+
else
|
|
18
|
+
flunk
|
|
19
|
+
end
|
|
20
|
+
end
|
|
10
21
|
end
|
metadata
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shoulda-let
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.5
|
|
4
5
|
prerelease:
|
|
5
|
-
version: 0.0.4
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Michael Grosser
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
|
|
15
|
+
name: shoulda
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
16
18
|
requirements:
|
|
17
19
|
- - ! '>='
|
|
18
20
|
- !ruby/object:Gem::Version
|
|
19
21
|
version: '0'
|
|
20
|
-
|
|
22
|
+
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
24
26
|
requirements:
|
|
25
27
|
- - ! '>='
|
|
26
28
|
- !ruby/object:Gem::Version
|
|
27
29
|
version: '0'
|
|
28
|
-
none: false
|
|
29
|
-
type: :runtime
|
|
30
30
|
description:
|
|
31
31
|
email: michael@grosser.it
|
|
32
32
|
executables: []
|
|
@@ -56,26 +56,26 @@ rdoc_options: []
|
|
|
56
56
|
require_paths:
|
|
57
57
|
- lib
|
|
58
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
|
+
none: false
|
|
59
60
|
requirements:
|
|
60
61
|
- - ! '>='
|
|
61
62
|
- !ruby/object:Gem::Version
|
|
62
63
|
version: '0'
|
|
63
64
|
segments:
|
|
64
65
|
- 0
|
|
65
|
-
hash:
|
|
66
|
-
none: false
|
|
66
|
+
hash: 2850818248656912426
|
|
67
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
|
+
none: false
|
|
68
69
|
requirements:
|
|
69
70
|
- - ! '>='
|
|
70
71
|
- !ruby/object:Gem::Version
|
|
71
72
|
version: '0'
|
|
72
73
|
segments:
|
|
73
74
|
- 0
|
|
74
|
-
hash:
|
|
75
|
-
none: false
|
|
75
|
+
hash: 2850818248656912426
|
|
76
76
|
requirements: []
|
|
77
77
|
rubyforge_project:
|
|
78
|
-
rubygems_version: 1.8.
|
|
78
|
+
rubygems_version: 1.8.25
|
|
79
79
|
signing_key:
|
|
80
80
|
specification_version: 3
|
|
81
81
|
summary: A simple let for shoulda
|