forms-spec 0.1.0 → 0.1.1
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/VERSION +1 -1
- data/forms-spec.gemspec +2 -2
- data/lib/forms-spec.rb +27 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/forms-spec.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{forms-spec}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-19}
|
13
13
|
s.description = %q{Adds RSpec 2 matchers to make expectations about your view code containing form logic}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/forms-spec.rb
CHANGED
@@ -1,4 +1,30 @@
|
|
1
1
|
require 'require_all'
|
2
2
|
require 'code-spec'
|
3
3
|
|
4
|
-
require_all File.dirname(__FILE__) + '/forms-spec'
|
4
|
+
require_all File.dirname(__FILE__) + '/forms-spec'
|
5
|
+
|
6
|
+
module FormHelperMacro
|
7
|
+
def with_form_helper name
|
8
|
+
class_eval do
|
9
|
+
include get_form_matcher(name)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
def get_form_matcher name
|
16
|
+
case name
|
17
|
+
when :formtastic
|
18
|
+
Erb::Formtastic::ContentMatchers
|
19
|
+
when :simpleform
|
20
|
+
Erb::SimpleForm::ContentMatchers
|
21
|
+
else
|
22
|
+
Erb::RailsForm::ContentMatchers
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
RSpec.configure do |config|
|
29
|
+
config.extend(FormHelperMacro)
|
30
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-19 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|