rspec-apigen 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspec-apigen/given.rb +4 -3
- data/lib/rspec-apigen/version.rb +1 -1
- metadata +3 -3
data/lib/rspec-apigen/given.rb
CHANGED
@@ -7,17 +7,17 @@ module RSpec::ApiGen
|
|
7
7
|
attr_accessor :return
|
8
8
|
|
9
9
|
|
10
|
-
#
|
10
|
+
# args - the list of arguments current method accept
|
11
11
|
# When the given block is evaluated in this method
|
12
12
|
# the Given#args will return a hash of name or argument and its value.
|
13
|
-
def initialize(context, method,
|
13
|
+
def initialize(context, method, args, given_caller, &block)
|
14
14
|
this = self # so we can access it as closure
|
15
15
|
@arg = Object.new
|
16
16
|
@args = {}
|
17
17
|
@fixtures = {}
|
18
18
|
block_arg = nil
|
19
19
|
|
20
|
-
|
20
|
+
args.find_all { |a| a.kind_of?(Argument) }.each do |a|
|
21
21
|
MetaHelper.create_singleton_method(@arg, "#{a.name}=") do |val|
|
22
22
|
this.args[a.name] = val
|
23
23
|
end
|
@@ -32,6 +32,7 @@ module RSpec::ApiGen
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
list_of_args = args.clone
|
35
36
|
context.it "no arguments" do
|
36
37
|
# create the arguments
|
37
38
|
MetaHelper.create_singleton_method(self, :arg) { this.arg }
|
data/lib/rspec-apigen/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Andreas Ronge
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-07 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|