pencil_pusher 0.0.12 → 1.0.0

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: c7f8b0c40a54a6f168b38266da8649e82c53eeac
4
- data.tar.gz: 61f5e4c69503dec3517cc707d2c27c940edd969c
3
+ metadata.gz: 0940af954a589fa4d7df7d89bf3c26c4bfa00c33
4
+ data.tar.gz: 1f2c9dfa97fa4ea2666496af80bd5ec61131b767
5
5
  SHA512:
6
- metadata.gz: c080a7c901efa9a20a5d56f8371b07d4b3749de9ea313d035fa23a6d4beb735ec5e32b3dce267dcc17f658fffdcae93b048ea546c578692438314b779d0bc87f
7
- data.tar.gz: 3aa64e91be5e53ecf5f9952fd9b4abebe84c7f8896e6b3dac06380d2184ec553ecc28c09cee965af62968e66cca7387931f00ea48672edbed33b21c770798a6b
6
+ metadata.gz: 1607f9debf2a4a68754e17d7c0add1a3953b1640f20fc64509f26dac5e9ea8602d48c8c1272b65e22a9adaaca825759cd3e5d386794aa9c5c2d58c24fe1e7a6a
7
+ data.tar.gz: e97dc459ea64b6dc600265ca11e942cd964c63f55703cb29b3f6d0d1cc9702d486ddb3bbd1386fdac0e57695931d63acbd72f150e0c89c259740a1e88991cf05
@@ -51,13 +51,13 @@ module PencilPusher
51
51
  data.slice(*attributes.keys)
52
52
  end
53
53
 
54
- private :attributes
55
- private
56
-
57
54
  def bound?
58
55
  @bound
59
56
  end
60
57
 
58
+ private :attributes
59
+ private
60
+
61
61
  def validated?
62
62
  @validated
63
63
  end
@@ -27,7 +27,7 @@ module PencilPusher
27
27
  "expected no errors for field #{field_name} but found #{actual.error_messages[field_name]}"
28
28
  end
29
29
 
30
- alias failure_message failure_message_for_should
30
+ alias failure_message failure_message_for_should
31
31
  alias failure_message_when_negated failure_message_for_should_not
32
32
 
33
33
  def description
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveIntField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, valid_value, error)
6
7
  @field_name = field_name
@@ -10,8 +11,8 @@ module PencilPusher
10
11
 
11
12
  def matches?(builder)
12
13
  begin
13
- FormBuilder.form(builder, {field_name => 'here'}).should have_errors(field_name, [error])
14
- FormBuilder.form(builder, field_name => valid_value).should_not have_errors(field_name)
14
+ expect(FormBuilder.form(builder, {field_name => 'here'})).to have_errors(field_name, [error])
15
+ expect(FormBuilder.form(builder, field_name => valid_value)).not_to have_errors(field_name)
15
16
  rescue => e
16
17
  @error = e.message
17
18
  raise e
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveRequiredChoiceField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, valid_values, blank_error, invalid_error)
6
7
  @field_name = field_name
@@ -11,11 +12,11 @@ module PencilPusher
11
12
 
12
13
  def matches?(form)
13
14
  begin
14
- form.should have_required_field(field_name, blank_error)
15
+ expect(form).to have_required_field(field_name, blank_error)
15
16
  builder = FormBuilder.builder(form)
16
- builder.call(field_name => 'invalid_value').should have_errors(field_name, [invalid_error])
17
+ expect(builder.call(field_name => 'invalid_value')).to have_errors(field_name, [invalid_error])
17
18
  valid_values.each do |valid_value|
18
- builder.call(field_name => valid_value.to_s).should_not have_errors(field_name)
19
+ expect(builder.call(field_name => valid_value.to_s)).not_to have_errors(field_name)
19
20
  end
20
21
  rescue => e
21
22
  @error = e.message
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveRequiredField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, error)
6
7
  @field_name = field_name
@@ -10,7 +11,7 @@ module PencilPusher
10
11
  def matches?(form)
11
12
  begin
12
13
  builder = FormBuilder.builder(form)
13
- builder.call(field_name => '').should have_errors(field_name, [error])
14
+ expect(builder.call(field_name => '')).to have_errors(field_name, [error])
14
15
  rescue => e
15
16
  @error = e.message
16
17
  raise e
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveRequiredFloatField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, valid_value, blank_error, invalid_error)
6
7
  @field_name = field_name
@@ -11,9 +12,9 @@ module PencilPusher
11
12
 
12
13
  def matches?(builder)
13
14
  begin
14
- builder.should have_required_field(field_name, blank_error)
15
- FormBuilder.form(builder, {field_name => 'here'}).should have_errors(field_name, [invalid_error])
16
- FormBuilder.form(builder, field_name => valid_value).should_not have_errors(field_name)
15
+ expect(builder).to have_required_field(field_name, blank_error)
16
+ expect(FormBuilder.form(builder, {field_name => 'here'})).to have_errors(field_name, [invalid_error])
17
+ expect(FormBuilder.form(builder, field_name => valid_value)).not_to have_errors(field_name)
17
18
  rescue => e
18
19
  @error = e.message
19
20
  raise e
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveRequiredIntField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, valid_value, blank_error, invalid_error)
6
7
  @field_name = field_name
@@ -11,8 +12,8 @@ module PencilPusher
11
12
 
12
13
  def matches?(builder)
13
14
  begin
14
- builder.should have_required_field(field_name, blank_error)
15
- builder.should have_int_field(field_name, valid_value, invalid_error)
15
+ expect(builder).to have_required_field(field_name, blank_error)
16
+ expect(builder).to have_int_field(field_name, valid_value, invalid_error)
16
17
  rescue => e
17
18
  @error = e.message
18
19
  raise e
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveRequiredTextField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, valid_value, error)
6
7
  @field_name = field_name
@@ -10,8 +11,8 @@ module PencilPusher
10
11
 
11
12
  def matches?(builder)
12
13
  begin
13
- builder.should have_required_field(field_name, error)
14
- builder.should have_text_field(field_name, valid_value)
14
+ expect(builder).to have_required_field(field_name, error)
15
+ expect(builder).to have_text_field(field_name, valid_value)
15
16
  rescue => e
16
17
  @error = e.message
17
18
  raise e
@@ -1,6 +1,7 @@
1
1
  module PencilPusher
2
2
  class HaveTextField
3
3
  include PencilPusher::Matchers
4
+ include RSpec::Matchers
4
5
 
5
6
  def initialize(field_name, valid_value)
6
7
  @field_name = field_name
@@ -9,7 +10,7 @@ module PencilPusher
9
10
 
10
11
  def matches?(builder)
11
12
  begin
12
- FormBuilder.form(builder, field_name => valid_value).should_not have_errors(field_name)
13
+ expect(FormBuilder.form(builder, field_name => valid_value)).not_to have_errors(field_name)
13
14
  rescue => e
14
15
  @error = e.message
15
16
  raise e
@@ -1,3 +1,5 @@
1
+ require 'rspec/expectations'
2
+
1
3
  module PencilPusher
2
4
  module Matchers
3
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pencil_pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Myles Megyesi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-22 00:00:00.000000000 Z
12
+ date: 2014-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -45,42 +45,42 @@ dependencies:
45
45
  requirements:
46
46
  - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: 0.10.0
48
+ version: 0.10.1
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: 0.10.0
55
+ version: 0.10.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: 10.3.2
62
+ version: 10.4.2
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 10.3.2
69
+ version: 10.4.2
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ~>
75
75
  - !ruby/object:Gem::Version
76
- version: 2.14.1
76
+ version: 3.1.0
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
- version: 2.14.1
83
+ version: 3.1.0
84
84
  description: Form builder and validator
85
85
  email:
86
86
  - myles.megyesi@gmail.com