trenni-formatters 2.8.1 → 2.12.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,7 +27,7 @@ module Trenni
25
27
  module Formatters
26
28
  module RelativeTime
27
29
  def self.included(base)
28
- base.map(Time) do |object, options|
30
+ base.map(Time) do |object, **options|
29
31
  current_time = options.fetch(:current_time) {Time.now}
30
32
 
31
33
  # Ensure we display the time in localtime, and show the year if it is different:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,28 +26,30 @@ require 'mapping/model'
24
26
  module Trenni
25
27
  module Formatters
26
28
  module TruncatedText
27
- def truncated_text(content, options = {})
29
+ def truncated_text(content, length: 30, **options)
28
30
  if content
29
- length = options.fetch(:length, 30)
30
-
31
- content = TruncatedText.truncate_text(content, length, options)
31
+ content = TruncatedText.truncate_text(content, length, **options)
32
32
 
33
33
  return self.format(content)
34
34
  end
35
35
  end
36
36
 
37
- def self.truncate_text(text, truncate_at, options = {})
37
+ def self.truncate_text(text, truncate_at, omission: nil, separator: nil, **options)
38
38
  return text.dup unless text.length > truncate_at
39
39
 
40
- options[:omission] ||= '...'
41
- length_with_room_for_omission = truncate_at - options[:omission].length
42
- stop = if options[:separator]
43
- text.rindex(options[:separator], length_with_room_for_omission) || length_with_room_for_omission
44
- else
45
- length_with_room_for_omission
40
+ omission ||= '...'
41
+
42
+ length_with_room_for_omission = truncate_at - omission.length
43
+
44
+ stop = nil
45
+
46
+ if separator
47
+ stop = text.rindex(separator, length_with_room_for_omission)
46
48
  end
47
49
 
48
- "#{text[0...stop]}#{options[:omission]}"
50
+ stop ||= length_with_room_for_omission
51
+
52
+ "#{text[0...stop]}#{omission}"
49
53
  end
50
54
  end
51
55
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,6 +22,6 @@
20
22
 
21
23
  module Trenni
22
24
  module Formatters
23
- VERSION = "2.8.1"
25
+ VERSION = "2.12.2"
24
26
  end
25
27
  end
metadata CHANGED
@@ -1,43 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trenni-formatters
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-28 00:00:00.000000000 Z
11
+ date: 2020-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: trenni
14
+ name: mapping
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.4'
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.4'
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: mapping
28
+ name: trenni
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.1'
33
+ version: '3.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.1'
40
+ version: '3.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bake-bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bake-modernize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: bundler
43
85
  requirement: !ruby/object:Gem::Requirement
@@ -53,21 +95,21 @@ dependencies:
53
95
  - !ruby/object:Gem::Version
54
96
  version: '0'
55
97
  - !ruby/object:Gem::Dependency
56
- name: rspec
98
+ name: covered
57
99
  requirement: !ruby/object:Gem::Requirement
58
100
  requirements:
59
- - - "~>"
101
+ - - ">="
60
102
  - !ruby/object:Gem::Version
61
- version: '3.4'
103
+ version: '0'
62
104
  type: :development
63
105
  prerelease: false
64
106
  version_requirements: !ruby/object:Gem::Requirement
65
107
  requirements:
66
- - - "~>"
108
+ - - ">="
67
109
  - !ruby/object:Gem::Version
68
- version: '3.4'
110
+ version: '0'
69
111
  - !ruby/object:Gem::Dependency
70
- name: rake
112
+ name: rspec
71
113
  requirement: !ruby/object:Gem::Requirement
72
114
  requirements:
73
115
  - - ">="
@@ -80,45 +122,30 @@ dependencies:
80
122
  - - ">="
81
123
  - !ruby/object:Gem::Version
82
124
  version: '0'
83
- description: "\tTrenni is a templating system, and these formatters assist with the
84
- development\n\tof typical view and form based web interface. A formatter is a high-level\n\tadapter
85
- that turns model data into presentation text.\n\n\tFormatters are designed to be
86
- customised, typically per-project, for specific\n\tformatting needs.\n"
125
+ description:
87
126
  email:
88
- - samuel.williams@oriontransfer.co.nz
89
127
  executables: []
90
128
  extensions: []
91
129
  extra_rdoc_files: []
92
130
  files:
93
- - ".gitignore"
94
- - ".rspec"
95
- - ".simplecov"
96
- - ".travis.yml"
97
- - Gemfile
98
- - README.md
99
- - Rakefile
100
131
  - lib/trenni/formatters.rb
101
132
  - lib/trenni/formatters/formatter.rb
133
+ - lib/trenni/formatters/html/accept_checkbox.rb
102
134
  - lib/trenni/formatters/html/definition_list_form.rb
103
135
  - lib/trenni/formatters/html/form_formatter.rb
136
+ - lib/trenni/formatters/html/label_form.rb
104
137
  - lib/trenni/formatters/html/option_select.rb
105
138
  - lib/trenni/formatters/html/radio_select.rb
106
139
  - lib/trenni/formatters/markdown.rb
107
140
  - lib/trenni/formatters/relative_time.rb
108
141
  - lib/trenni/formatters/truncated_text.rb
109
142
  - lib/trenni/formatters/version.rb
110
- - spec/trenni/formatters/formatters_spec.rb
111
- - spec/trenni/formatters/html/form_formatter_spec.rb
112
- - spec/trenni/formatters/html/option_select_spec.rb
113
- - spec/trenni/formatters/html/radio_select_spec.rb
114
- - spec/trenni/formatters/markdown_spec.rb
115
- - spec/trenni/formatters/relative_time_spec.rb
116
- - spec/trenni/formatters/truncated_text_spec.rb
117
- - trenni-formatters.gemspec
118
143
  homepage: https://github.com/ioquatix/trenni-formatters
119
- licenses: []
120
- metadata: {}
121
- post_install_message:
144
+ licenses:
145
+ - MIT
146
+ metadata:
147
+ funding_uri: https://github.com/sponsors/ioquatix/
148
+ post_install_message:
122
149
  rdoc_options: []
123
150
  require_paths:
124
151
  - lib
@@ -126,22 +153,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
153
  requirements:
127
154
  - - ">="
128
155
  - !ruby/object:Gem::Version
129
- version: '0'
156
+ version: '2.5'
130
157
  required_rubygems_version: !ruby/object:Gem::Requirement
131
158
  requirements:
132
159
  - - ">="
133
160
  - !ruby/object:Gem::Version
134
161
  version: '0'
135
162
  requirements: []
136
- rubygems_version: 3.0.1
137
- signing_key:
163
+ rubygems_version: 3.1.2
164
+ signing_key:
138
165
  specification_version: 4
139
166
  summary: Formatters for Trenni, to assist with typical views and form based interfaces.
140
- test_files:
141
- - spec/trenni/formatters/formatters_spec.rb
142
- - spec/trenni/formatters/html/form_formatter_spec.rb
143
- - spec/trenni/formatters/html/option_select_spec.rb
144
- - spec/trenni/formatters/html/radio_select_spec.rb
145
- - spec/trenni/formatters/markdown_spec.rb
146
- - spec/trenni/formatters/relative_time_spec.rb
147
- - spec/trenni/formatters/truncated_text_spec.rb
167
+ test_files: []
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --color
2
- --format documentation
3
- --backtrace
4
- --warnings
data/.simplecov DELETED
@@ -1,9 +0,0 @@
1
-
2
- SimpleCov.start do
3
- add_filter "/spec/"
4
- end
5
-
6
- if ENV['TRAVIS']
7
- require 'coveralls'
8
- Coveralls.wear!
9
- end
@@ -1,8 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.3
5
- - 2.4
6
- - 2.5
7
- - 2.6
8
- - ruby-head
data/Gemfile DELETED
@@ -1,12 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in trenni-formatters.gemspec
4
- gemspec
5
-
6
- group :test do
7
- gem 'sanitize'
8
- gem 'kramdown'
9
-
10
- gem 'simplecov'
11
- gem 'coveralls', require: false
12
- end
data/README.md DELETED
@@ -1,77 +0,0 @@
1
- # Trenni::Formatters
2
-
3
- Trenni is a templating system, and these formatters assist with the development
4
- of typical view and form based web interface. A formatter is a high-level
5
- adapter that turns model data into presentation text.
6
-
7
- Formatters are designed to be customised, typically per-project, for specific
8
- formatting needs.
9
-
10
- [![Build Status](https://travis-ci.org/ioquatix/trenni-formatters.svg?branch=master)](https://travis-ci.org/ioquatix/trenni-formatters)
11
- [![Code Climate](https://codeclimate.com/github/ioquatix/trenni-formatters.png)](https://codeclimate.com/github/ioquatix/trenni-formatters)
12
- [![Coverage Status](https://coveralls.io/repos/ioquatix/trenni-formatters/badge.svg)](https://coveralls.io/r/ioquatix/trenni-formatters)
13
-
14
- ## Motivation
15
-
16
- `Trenni::Formatters` was a library extracted from [Financier](https://github.com/ioquatix/financier) which is a CouchDB backed invoicing system, itself, derived from an old Rails app. I was a bit envious of `form_for` in terms of the ease of generating forms, but found that it wasn't very extendable. I also found myself generating code to format model data as rich HTML. `Trenni::Formatters` attempts to be an easily extendable formatting module which can generate rich text, links and HTML.
17
-
18
- ## Installation
19
-
20
- Add this line to your application's Gemfile:
21
-
22
- gem 'trenni-formatters'
23
-
24
- And then execute:
25
-
26
- $ bundle
27
-
28
- Or install it yourself as:
29
-
30
- $ gem install trenni-formatters
31
-
32
- ## Usage
33
-
34
- The most basic usage involves converting model data into presentation text by
35
- a mapping corresponding to the objects type:
36
-
37
- formatter = Trenni::Formatters::Formatter.new
38
-
39
- formatter.for(String) do |value, options|
40
- "String: #{value}"
41
- end
42
-
43
- expect(formatter.format("foobar")).to be == "String: foobar"
44
-
45
- For more examples please see `spec/`.
46
-
47
- ## Contributing
48
-
49
- 1. Fork it
50
- 2. Create your feature branch (`git checkout -b my-new-feature`)
51
- 3. Commit your changes (`git commit -am 'Add some feature'`)
52
- 4. Push to the branch (`git push origin my-new-feature`)
53
- 5. Create new Pull Request
54
-
55
- ## License
56
-
57
- Released under the MIT license.
58
-
59
- Copyright, 2014, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
60
-
61
- Permission is hereby granted, free of charge, to any person obtaining a copy
62
- of this software and associated documentation files (the "Software"), to deal
63
- in the Software without restriction, including without limitation the rights
64
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
65
- copies of the Software, and to permit persons to whom the Software is
66
- furnished to do so, subject to the following conditions:
67
-
68
- The above copyright notice and this permission notice shall be included in
69
- all copies or substantial portions of the Software.
70
-
71
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
73
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
74
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
75
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
76
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
77
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec) do |task|
5
- task.rspec_opts = ["--require", "simplecov"] if ENV['COVERAGE']
6
- end
7
-
8
- task :default => :spec
@@ -1,186 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'trenni/formatters'
22
- require 'trenni/formatters/html/definition_list_form'
23
-
24
- module Trenni::Formatters::FormFormatterSpec
25
- class FormFormatter < Trenni::Formatters::Formatter
26
- include Trenni::Formatters::HTML::DefinitionListForm
27
- end
28
-
29
- describe Trenni::Formatters do
30
- let(:formatter) {FormFormatter.for(double(bar: 10))}
31
-
32
- it "should generate form" do
33
- result = formatter.input(:field => :bar)
34
- expect(result).to be == %Q{<dt>Bar</dt>\n<dd><input name="bar" value="10"/></dd>}
35
- end
36
-
37
- it "should have default value" do
38
- expect(formatter.value_for(:value => 10)).to be == "10"
39
- expect(formatter.value_for(:value => nil, :default => 10)).to be == "10"
40
- end
41
-
42
- it "should have a different title" do
43
- result = formatter.input(:field => :bar, :title => "Title")
44
- expect(result).to be == %Q{<dt>Title</dt>\n<dd><input name="bar" value="10"/></dd>}
45
- end
46
-
47
- context "with key" do
48
- let(:formatter) {FormFormatter.for(double(bar: 10), nested_name: 'attributes')}
49
-
50
- it "should generate form with nested name" do
51
- result = formatter.input(:field => :bar)
52
- expect(result).to be == %Q{<dt>Bar</dt>\n<dd><input name="attributes[bar]" value="10"/></dd>}
53
- end
54
- end
55
-
56
- context "with nested object" do
57
- let(:formatter) {FormFormatter.for(double(animal: double(name: "cat")))}
58
-
59
- it "can generate nested attributes" do
60
- result = formatter.nested(:animal) do |formatter|
61
- formatter.input(field: :name)
62
- end
63
-
64
- expect(result).to be == %Q{<dt>Name</dt>\n<dd><input name="animal[name]" value="cat"/></dd>}
65
- end
66
- end
67
- end
68
-
69
- describe "<input>" do
70
- let(:formatter) {FormFormatter.new(:object => double(bar: 10, bob: true, dole: false))}
71
-
72
- it "should support support min, max and step" do
73
- attributes = formatter.input_attributes_for(:min => 10, :max => 20, :step => 2)
74
-
75
- expect(attributes[:min]).to be == 10
76
- expect(attributes[:max]).to be == 20
77
- expect(attributes[:step]).to be == 2
78
-
79
- result = formatter.input(:field => :bar, :min => 10)
80
- expect(result).to be == %Q{<dt>Bar</dt>\n<dd><input name="bar" value="10" min="10"/></dd>}
81
- end
82
-
83
- it "should not specify required, readonly or disabled" do
84
- attributes = formatter.input_attributes_for(:field => :bar)
85
- expect(attributes[:required]).to be nil
86
- expect(attributes[:readonly]).to be nil
87
- expect(attributes[:disabled]).to be nil
88
- end
89
-
90
- it "should specify required, readonly or disabled" do
91
- attributes = formatter.input_attributes_for(:field => :bar, :required => true, :readonly => true, :disabled => true)
92
- expect(attributes[:required]).to be true
93
- expect(attributes[:readonly]).to be true
94
- expect(attributes[:disabled]).to be true
95
- end
96
-
97
- it "should generate checked checkbox" do
98
- attributes = formatter.checkbox_attributes_for(:value => true)
99
- expect(attributes[:checked]).to be true
100
-
101
- result = formatter.checkbox(:field => :bob)
102
- expect(result).to be == %Q{<dd>\n\t<input type="hidden" name="bob" value="false"/>\n\t<label><input type="checkbox" name="bob" value="true" checked/> Bob</label>\n</dd>}
103
- end
104
-
105
- it "should generate unchecked checkbox" do
106
- attributes = formatter.checkbox_attributes_for(:value => false)
107
- expect(attributes[:checked]).to be nil
108
-
109
- result = formatter.checkbox(:field => :dole)
110
- expect(result).to be == %Q{<dd>\n\t<input type="hidden" name="dole" value="false"/>\n\t<label><input type="checkbox" name="dole" value="true"/> Dole</label>\n</dd>}
111
- end
112
- end
113
-
114
- describe '<input type="hidden">' do
115
- let(:formatter) {FormFormatter.new(:object => double(age: 20))}
116
-
117
- it "should generate hidden field" do
118
- result = formatter.hidden(:field => :age)
119
- expect(result).to be == %Q{<input type="hidden" name="age" value="20"/>}
120
- end
121
-
122
- it "should escape characters correctly" do
123
- expect(formatter.object).to receive(:new_record?).and_return(false)
124
-
125
- result = formatter.submit
126
- expect(result).to be == %Q{<input type="submit" value="Update"/>}
127
- end
128
-
129
- it "can have custom title" do
130
- result = formatter.submit(title: 'Alice')
131
- expect(result).to be == %Q{<input type="submit" value="Alice"/>}
132
- end
133
- end
134
-
135
- describe '<input type="submit">' do
136
- let(:new_record_formatter) {FormFormatter.new(:object => double(new_record?: true))}
137
- let(:formatter) {FormFormatter.new(:object => double(new_record?: false))}
138
-
139
- it "should have correct title for new_record?" do
140
- result = new_record_formatter.submit
141
- expect(result).to be == %Q{<input type="submit" value="Create"/>}
142
- end
143
-
144
- it "should escape characters correctly" do
145
- result = formatter.submit
146
- expect(result).to be == %Q{<input type="submit" value="Update"/>}
147
- end
148
-
149
- it "can have custom title" do
150
- result = formatter.submit(title: 'Alice')
151
- expect(result).to be == %Q{<input type="submit" value="Alice"/>}
152
- end
153
- end
154
-
155
- describe "<textarea>" do
156
- let(:formatter) {FormFormatter.new(:object => double(details: "foo<bar>"))}
157
-
158
- it "should escape characters correctly" do
159
- result = formatter.textarea(:field => :details)
160
- expect(result).to be == %Q{<dt>\n\tDetails\n</dt>\n<dd><textarea name=\"details\">foo&lt;bar&gt;</textarea></dd>}
161
- end
162
- end
163
-
164
- describe "<output>" do
165
- let(:formatter) {FormFormatter.new(:object => double(bar: 10, bob: true, dole: false))}
166
-
167
- it "should show output value" do
168
- result = formatter.output(:field => :bar)
169
- expect(result).to be == %Q{<dt>Bar</dt>\n<dd><output name=\"bar\">10</output></dd>}
170
- end
171
-
172
- it "should show output value" do
173
- result = formatter.output(:name => :total)
174
- expect(result).to be == %Q{<dt></dt>\n<dd><output name=\"total\"></output></dd>}
175
- end
176
- end
177
-
178
- describe "<button>" do
179
- let(:formatter) {FormFormatter.new}
180
-
181
- it "should generate reset button" do
182
- result = formatter.button(:type => :reset)
183
- expect(result).to be == %Q{<button type="reset">Reset</button>}
184
- end
185
- end
186
- end