swiss_knife 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20fbdb31c225cb32272d6b583b130306e8f1af04
|
4
|
+
data.tar.gz: c6bb27154af3dc7b320e58fbabdc51b467494985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3f0240074d34665c81aaf9758789154db92ca3fc2cfc8dbfdc52a6d731a54b3ce909a8f2735ec245eb0fd12d16b4f90442674b85020fa31104cbc7f4b500611
|
7
|
+
data.tar.gz: fac244842bf7014907bb360fbbe1530528dbe329ce66e7cd2eb845a51e9826716f63cdd3b36a447c3c2f9d24be681af8a8cccb7dff16a2bac9bcd5ccf4fb15f9
|
data/Gemfile.lock
CHANGED
data/lib/swiss_knife/rspec.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module SwissKnife
|
2
2
|
module RSpec
|
3
3
|
module Matchers
|
4
|
-
def
|
5
|
-
|
4
|
+
def accept(*values)
|
5
|
+
Accept.new(values)
|
6
6
|
end
|
7
7
|
|
8
|
-
class
|
8
|
+
class Accept
|
9
9
|
attr_accessor :values, :record, :failed, :attribute
|
10
10
|
|
11
11
|
def initialize(values)
|
data/lib/swiss_knife/version.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
require "swiss_knife/rspec/
|
1
|
+
require "swiss_knife/rspec/accept"
|
2
2
|
require "active_record"
|
3
3
|
|
4
4
|
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
|
5
5
|
|
6
6
|
require File.expand_path("../../../schema", __FILE__)
|
7
7
|
|
8
|
-
describe "
|
8
|
+
describe "accept matcher" do
|
9
9
|
include SwissKnife::RSpec::Matchers
|
10
10
|
|
11
|
-
it "
|
11
|
+
it "accepts blank values" do
|
12
12
|
klass = Class.new(ActiveRecord::Base) do
|
13
13
|
self.table_name = "users"
|
14
14
|
end
|
15
15
|
|
16
16
|
record = klass.new
|
17
|
-
record.should
|
17
|
+
record.should accept(nil, "").for(:name)
|
18
18
|
end
|
19
19
|
|
20
20
|
it "requires name to be set" do
|
@@ -26,15 +26,15 @@ describe "allow matcher" do
|
|
26
26
|
klass.stub name: "User"
|
27
27
|
|
28
28
|
record = klass.new
|
29
|
-
record.should_not
|
29
|
+
record.should_not accept(nil, "").for(:name)
|
30
30
|
end
|
31
31
|
|
32
|
-
it "
|
32
|
+
it "accepts values" do
|
33
33
|
klass = Class.new(ActiveRecord::Base) do
|
34
34
|
self.table_name = "users"
|
35
35
|
end
|
36
36
|
|
37
37
|
record = klass.new
|
38
|
-
record.should
|
38
|
+
record.should accept("John Doe", "Jane Doe").for(:name)
|
39
39
|
end
|
40
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swiss_knife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
@@ -133,7 +133,7 @@ files:
|
|
133
133
|
- lib/swiss_knife/railtie.rb
|
134
134
|
- lib/swiss_knife/rake_tasks.rb
|
135
135
|
- lib/swiss_knife/rspec.rb
|
136
|
-
- lib/swiss_knife/rspec/
|
136
|
+
- lib/swiss_knife/rspec/accept.rb
|
137
137
|
- lib/swiss_knife/rspec/have_error_on.rb
|
138
138
|
- lib/swiss_knife/rspec/have_tag.rb
|
139
139
|
- lib/swiss_knife/rspec/have_text.rb
|
@@ -171,7 +171,7 @@ files:
|
|
171
171
|
- spec/swiss_knife/i18n_js_spec.rb
|
172
172
|
- spec/swiss_knife/jquery_spec.rb
|
173
173
|
- spec/swiss_knife/jquery_ujs_spec.rb
|
174
|
-
- spec/swiss_knife/rspec/
|
174
|
+
- spec/swiss_knife/rspec/accept_spec.rb
|
175
175
|
- spec/swiss_knife/rspec/have_error_on_spec.rb
|
176
176
|
- spec/swiss_knife/rspec/have_text_spec.rb
|
177
177
|
- swiss_knife.gemspec
|