xforms 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,7 +61,7 @@ module XForms
61
61
  return data unless type
62
62
 
63
63
  case type
64
- when 'int' then Integer(data)
64
+ when 'int' then Integer(data) rescue 0
65
65
  else data
66
66
  end
67
67
  end
@@ -1,3 +1,3 @@
1
1
  module XForms
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -108,6 +108,11 @@ describe "Form" do
108
108
  form.controls[6].value.should == 123
109
109
  end
110
110
 
111
+ it "get input value with int type when data is empty" do
112
+ model.xpath('x:data/x:foo').first.children = ''
113
+ form.controls[6].value.should == 0
114
+ end
115
+
111
116
  it "set input value with int type" do
112
117
  form.controls[6].value = '01'
113
118
  model.xpath('x:data/x:foo').inner_text.should == '1'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xforms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-30 00:00:00.000000000 Z
13
+ date: 2012-04-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &70324868262480 !ruby/object:Gem::Requirement
17
+ requirement: &70194500648500 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *70324868262480
25
+ version_requirements: *70194500648500
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: nokogiri
28
- requirement: &70324868262040 !ruby/object:Gem::Requirement
28
+ requirement: &70194500648060 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70324868262040
36
+ version_requirements: *70194500648060
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: i18n
39
- requirement: &70324868261600 !ruby/object:Gem::Requirement
39
+ requirement: &70194500647620 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70324868261600
47
+ version_requirements: *70194500647620
48
48
  description: This gem can be used to parse and fill XForms 1.1
49
49
  email:
50
50
  - jwajnerman@manas.com.ar