fortio-namelist 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require "fortio-namelist"
2
2
  require "rspec-power_assert"
3
3
 
4
- describe FortIO::Namelist do
4
+ describe "FortIO::Namelist" do
5
5
 
6
6
  example "newline enumeration" do
7
7
  input = %{
@@ -12,11 +12,11 @@ describe FortIO::Namelist do
12
12
  /
13
13
  }
14
14
  nml = FortIO::Namelist.read(input)
15
- is_asserted_by { nml.has_key? "example" }
16
- is_asserted_by { nml["example"].is_a? Hash }
17
- is_asserted_by { nml["example"].keys.size == 3 }
18
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
19
- is_asserted_by { nml["example"].values == [1,2,3] }
15
+ is_asserted_by { nml.has_key? :example }
16
+ is_asserted_by { nml[:example].is_a? Hash }
17
+ is_asserted_by { nml[:example].keys.size == 3 }
18
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
19
+ is_asserted_by { nml[:example].values == [1,2,3] }
20
20
  end
21
21
 
22
22
  example "space enumeration" do
@@ -24,11 +24,11 @@ describe FortIO::Namelist do
24
24
  &example a = 1 ab = 2 abc = 3 /
25
25
  }
26
26
  nml = FortIO::Namelist.read(input)
27
- is_asserted_by { nml.has_key? "example" }
28
- is_asserted_by { nml["example"].is_a? Hash }
29
- is_asserted_by { nml["example"].keys.size == 3 }
30
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
31
- is_asserted_by { nml["example"].values == [1,2,3] }
27
+ is_asserted_by { nml.has_key? :example }
28
+ is_asserted_by { nml[:example].is_a? Hash }
29
+ is_asserted_by { nml[:example].keys.size == 3 }
30
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
31
+ is_asserted_by { nml[:example].values == [1,2,3] }
32
32
  end
33
33
 
34
34
  example "space enumeration 2" do
@@ -38,11 +38,11 @@ describe FortIO::Namelist do
38
38
  /
39
39
  }
40
40
  nml = FortIO::Namelist.read(input)
41
- is_asserted_by { nml.has_key? "example" }
42
- is_asserted_by { nml["example"].is_a? Hash }
43
- is_asserted_by { nml["example"].keys.size == 3 }
44
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
45
- is_asserted_by { nml["example"].values == [1,2,3] }
41
+ is_asserted_by { nml.has_key? :example }
42
+ is_asserted_by { nml[:example].is_a? Hash }
43
+ is_asserted_by { nml[:example].keys.size == 3 }
44
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
45
+ is_asserted_by { nml[:example].values == [1,2,3] }
46
46
  end
47
47
 
48
48
  example "comma enumeration" do
@@ -50,11 +50,11 @@ describe FortIO::Namelist do
50
50
  &example a = 1, ab = 2, abc = 3 /
51
51
  }
52
52
  nml = FortIO::Namelist.read(input)
53
- is_asserted_by { nml.has_key? "example" }
54
- is_asserted_by { nml["example"].is_a? Hash }
55
- is_asserted_by { nml["example"].keys.size == 3 }
56
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
57
- is_asserted_by { nml["example"].values == [1,2,3] }
53
+ is_asserted_by { nml.has_key? :example }
54
+ is_asserted_by { nml[:example].is_a? Hash }
55
+ is_asserted_by { nml[:example].keys.size == 3 }
56
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
57
+ is_asserted_by { nml[:example].values == [1,2,3] }
58
58
  end
59
59
 
60
60
  example "comma enumeration 2" do
@@ -64,11 +64,11 @@ describe FortIO::Namelist do
64
64
  /
65
65
  }
66
66
  nml = FortIO::Namelist.read(input)
67
- is_asserted_by { nml.has_key? "example" }
68
- is_asserted_by { nml["example"].is_a? Hash }
69
- is_asserted_by { nml["example"].keys.size == 3 }
70
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
71
- is_asserted_by { nml["example"].values == [1,2,3] }
67
+ is_asserted_by { nml.has_key? :example }
68
+ is_asserted_by { nml[:example].is_a? Hash }
69
+ is_asserted_by { nml[:example].keys.size == 3 }
70
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
71
+ is_asserted_by { nml[:example].values == [1,2,3] }
72
72
  end
73
73
 
74
74
  example "comma newline enumeration" do
@@ -80,11 +80,11 @@ describe FortIO::Namelist do
80
80
  /
81
81
  }
82
82
  nml = FortIO::Namelist.read(input)
83
- is_asserted_by { nml.has_key? "example" }
84
- is_asserted_by { nml["example"].is_a? Hash }
85
- is_asserted_by { nml["example"].keys.size == 3 }
86
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
87
- is_asserted_by { nml["example"].values == [1,2,3] }
83
+ is_asserted_by { nml.has_key? :example }
84
+ is_asserted_by { nml[:example].is_a? Hash }
85
+ is_asserted_by { nml[:example].keys.size == 3 }
86
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
87
+ is_asserted_by { nml[:example].values == [1,2,3] }
88
88
  end
89
89
 
90
90
  example "last comma is permitted" do
@@ -96,11 +96,11 @@ describe FortIO::Namelist do
96
96
  /
97
97
  }
98
98
  nml = FortIO::Namelist.read(input)
99
- is_asserted_by { nml.has_key? "example" }
100
- is_asserted_by { nml["example"].is_a? Hash }
101
- is_asserted_by { nml["example"].keys.size == 3 }
102
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
103
- is_asserted_by { nml["example"].values == [1,2,3] }
99
+ is_asserted_by { nml.has_key? :example }
100
+ is_asserted_by { nml[:example].is_a? Hash }
101
+ is_asserted_by { nml[:example].keys.size == 3 }
102
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
103
+ is_asserted_by { nml[:example].values == [1,2,3] }
104
104
  end
105
105
 
106
106
  example "comma space hybrid" do
@@ -111,11 +111,11 @@ describe FortIO::Namelist do
111
111
  /
112
112
  }
113
113
  nml = FortIO::Namelist.read(input)
114
- is_asserted_by { nml.has_key? "example" }
115
- is_asserted_by { nml["example"].is_a? Hash }
116
- is_asserted_by { nml["example"].keys.size == 3 }
117
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
118
- is_asserted_by { nml["example"].values == [1,2,3] }
114
+ is_asserted_by { nml.has_key? :example }
115
+ is_asserted_by { nml[:example].is_a? Hash }
116
+ is_asserted_by { nml[:example].keys.size == 3 }
117
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
118
+ is_asserted_by { nml[:example].values == [1,2,3] }
119
119
  end
120
120
 
121
121
  example "space before and after equal symbol" do
@@ -127,11 +127,35 @@ describe FortIO::Namelist do
127
127
  /
128
128
  }
129
129
  nml = FortIO::Namelist.read(input)
130
- is_asserted_by { nml.has_key? "example" }
131
- is_asserted_by { nml["example"].is_a? Hash }
132
- is_asserted_by { nml["example"].keys.size == 3 }
133
- is_asserted_by { nml["example"].keys == ["a","ab","abc"] }
134
- is_asserted_by { nml["example"].values == [1,2,3] }
130
+ is_asserted_by { nml.has_key? :example }
131
+ is_asserted_by { nml[:example].is_a? Hash }
132
+ is_asserted_by { nml[:example].keys.size == 3 }
133
+ is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
134
+ is_asserted_by { nml[:example].values == [1,2,3] }
135
+ end
136
+
137
+ example "newline before and after equal symbol" do
138
+ input = %{
139
+ &example
140
+ a =
141
+ 1
142
+ b
143
+ = 2
144
+ c
145
+ =
146
+ 3
147
+ ,
148
+ d
149
+ =
150
+ 4
151
+ /
152
+ }
153
+ nml = FortIO::Namelist.read(input)
154
+ is_asserted_by { nml.has_key? :example }
155
+ is_asserted_by { nml[:example].is_a? Hash }
156
+ is_asserted_by { nml[:example].keys.size == 4 }
157
+ is_asserted_by { nml[:example].keys == [:a,:b,:c,:d] }
158
+ is_asserted_by { nml[:example].values == [1,2,3,4] }
135
159
  end
136
160
 
137
161
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortio-namelist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Motoyoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-28 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: racc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
13
27
  description: " A library for reading/writing fortran namelist file\n"
14
28
  email: ''
15
29
  executables: []