code-spec 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/code-spec.gemspec +1 -1
- data/lib/code_spec/matchers/have_call.rb +2 -1
- data/spec/code-spec/matchers/have_call_args.rb +11 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/code-spec.gemspec
CHANGED
@@ -32,7 +32,8 @@ module RSpec::RubyContentMatchers
|
|
32
32
|
args_expr
|
33
33
|
when Array
|
34
34
|
args.inject("") do |res, arg|
|
35
|
-
|
35
|
+
arg_val = (arg.kind_of?(String) && arg[0] == '#') ? arg[1..-1] : arg.inspect
|
36
|
+
res << '(\s|,|\w|:)*' + arg_val
|
36
37
|
end
|
37
38
|
else
|
38
39
|
return nil
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'method call matcher with args' do
|
4
|
-
context "content with call
|
4
|
+
context "content with call devise" do
|
5
5
|
call = %{
|
6
6
|
devise :database_authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable
|
7
7
|
}
|
@@ -10,4 +10,14 @@ describe 'method call matcher with args' do
|
|
10
10
|
call.should_not have_call :devise, :args => [:confirmable, :trackable_ids]
|
11
11
|
end
|
12
12
|
end
|
13
|
+
|
14
|
+
context "content with call devise" do
|
15
|
+
call = %{
|
16
|
+
devise :database_authenticatable, confirm_me, :recoverable, "hello"
|
17
|
+
}
|
18
|
+
it "should have call to hello" do
|
19
|
+
call.should have_call :devise, :args => ['#confirm_me', "hello"]
|
20
|
+
call.should_not have_call :devise, :args => ['#hello']
|
21
|
+
end
|
22
|
+
end
|
13
23
|
end
|