jruby-lint 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -184,4 +184,82 @@ describe JRuby::Lint::Checkers do
184
184
  end
185
185
 
186
186
  end
187
+
188
+ context "Non-atomic operator assignment" do
189
+ Given(:checker) { JRuby::Lint::Checkers::NonAtomic.new }
190
+
191
+ context "class variable or-assignment" do
192
+ Given(:script) { "@@foo ||= 1" }
193
+ When { collector.run }
194
+ Then { collector.findings.size.should == 1 }
195
+ end
196
+
197
+ context "instance variable or-assignment" do
198
+ Given(:script) { "@foo ||= 1" }
199
+ When { collector.run }
200
+ Then { collector.findings.size.should == 1 }
201
+ end
202
+
203
+ context "attribute or-assignment" do
204
+ Given(:script) { "foo.bar ||= 1" }
205
+ When { collector.run }
206
+ Then { collector.findings.size.should == 1 }
207
+ end
208
+
209
+ context "element or-assignment" do
210
+ Given(:script) { "foo[bar] ||= 1" }
211
+ When { collector.run }
212
+ Then { collector.findings.size.should == 1 }
213
+ end
214
+
215
+ context "class variable and-assignment" do
216
+ Given(:script) { "@@foo &&= 1" }
217
+ When { collector.run }
218
+ Then { collector.findings.size.should == 1 }
219
+ end
220
+
221
+ context "instance variable and-assignment" do
222
+ Given(:script) { "@foo &&= 1" }
223
+ When { collector.run }
224
+ Then { collector.findings.size.should == 1 }
225
+ end
226
+
227
+ context "attribute and-assignment" do
228
+ Given(:script) { "foo.bar &&= 1" }
229
+ When { collector.run }
230
+ Then { collector.findings.size.should == 1 }
231
+ end
232
+
233
+ context "element and-assignment" do
234
+ Given(:script) { "foo[bar] &&= 1" }
235
+ When { collector.run }
236
+ Then { collector.findings.size.should == 1 }
237
+ end
238
+
239
+ pending "needs better representation in AST" do
240
+ context "class variable op-assignment" do
241
+ Given(:script) { "@@foo += 1" }
242
+ When { collector.run }
243
+ Then { collector.findings.size.should == 1 }
244
+ end
245
+
246
+ context "instance variable op-assignment" do
247
+ Given(:script) { "@foo += 1" }
248
+ When { collector.run }
249
+ Then { collector.findings.size.should == 1 }
250
+ end
251
+ end
252
+
253
+ context "attribute op-assignment" do
254
+ Given(:script) { "foo.bar += 1" }
255
+ When { collector.run }
256
+ Then { collector.findings.size.should == 1 }
257
+ end
258
+
259
+ context "element op-assignment" do
260
+ Given(:script) { "foo[bar] += 1" }
261
+ When { collector.run }
262
+ Then { collector.findings.size.should == 1 }
263
+ end
264
+ end
187
265
  end
metadata CHANGED
@@ -2,27 +2,27 @@
2
2
  name: jruby-lint
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nick Sieger
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-01 00:00:00.000000000 Z
12
+ date: 2013-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: term-ansicolor
16
16
  version_requirements: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: !binary |-
21
21
  MA==
22
22
  none: false
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: !binary |-
28
28
  MA==
@@ -33,14 +33,14 @@ dependencies:
33
33
  name: jruby-openssl
34
34
  version_requirements: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - ! '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: !binary |-
39
39
  MA==
40
40
  none: false
41
41
  requirement: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - ! '>='
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: !binary |-
46
46
  MA==
@@ -51,13 +51,13 @@ dependencies:
51
51
  name: nokogiri
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.5.0.beta.4
57
57
  none: false
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: 1.5.0.beta.4
63
63
  none: false
@@ -67,14 +67,14 @@ dependencies:
67
67
  name: rake
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - ! '>='
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: !binary |-
73
73
  MA==
74
74
  none: false
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ! '>='
77
+ - - ">="
78
78
  - !ruby/object:Gem::Version
79
79
  version: !binary |-
80
80
  MA==
@@ -85,13 +85,13 @@ dependencies:
85
85
  name: rspec
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ! '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '2.5'
91
91
  none: false
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '2.5'
97
97
  none: false
@@ -101,14 +101,14 @@ dependencies:
101
101
  name: rspec-given
102
102
  version_requirements: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ! '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: !binary |-
107
107
  MA==
108
108
  none: false
109
109
  requirement: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ! '>='
111
+ - - ">="
112
112
  - !ruby/object:Gem::Version
113
113
  version: !binary |-
114
114
  MA==
@@ -119,24 +119,27 @@ dependencies:
119
119
  name: aruba
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: !binary |-
125
125
  MA==
126
126
  none: false
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: !binary |-
132
132
  MA==
133
133
  none: false
134
134
  prerelease: false
135
135
  type: :development
136
- description: ! "This utility presents hints and suggestions to\n give you an idea\
137
- \ of potentially troublesome spots in your code and\n dependencies that keep your\
138
- \ code from running efficiently on JRuby.\n\n Most pure Ruby code will run fine,\
139
- \ but the two common areas that\n trip people up are native extensions and threading"
136
+ description: |-
137
+ This utility presents hints and suggestions to
138
+ give you an idea of potentially troublesome spots in your code and
139
+ dependencies that keep your code from running efficiently on JRuby.
140
+
141
+ Most pure Ruby code will run fine, but the two common areas that
142
+ trip people up are native extensions and threading
140
143
  email:
141
144
  - nick@nicksieger.com
142
145
  executables:
@@ -144,11 +147,12 @@ executables:
144
147
  extensions: []
145
148
  extra_rdoc_files: []
146
149
  files:
147
- - .gitignore
150
+ - ".gitignore"
148
151
  - Gemfile
149
152
  - Gemfile.lock
150
153
  - Guardfile
151
154
  - History.txt
155
+ - LICENSE.txt
152
156
  - README.md
153
157
  - Rakefile
154
158
  - bin/jrlint
@@ -159,6 +163,7 @@ files:
159
163
  - lib/jruby/lint/checkers/fork_exec.rb
160
164
  - lib/jruby/lint/checkers/gem.rb
161
165
  - lib/jruby/lint/checkers/gemspec.rb
166
+ - lib/jruby/lint/checkers/nonatomic.rb
162
167
  - lib/jruby/lint/checkers/object_space.rb
163
168
  - lib/jruby/lint/checkers/system.rb
164
169
  - lib/jruby/lint/checkers/thread_critical.rb
@@ -190,14 +195,17 @@ files:
190
195
  - spec/jruby/lint/version_spec.rb
191
196
  - spec/spec_helper.rb
192
197
  homepage: https://github.com/jruby/jruby-lint
193
- licenses: []
198
+ licenses:
199
+ - EPL 1.0
200
+ - GPL 2
201
+ - LGPL 2.1
194
202
  post_install_message:
195
203
  rdoc_options: []
196
204
  require_paths:
197
205
  - lib
198
206
  required_ruby_version: !ruby/object:Gem::Requirement
199
207
  requirements:
200
- - - ! '>='
208
+ - - ">="
201
209
  - !ruby/object:Gem::Version
202
210
  segments:
203
211
  - 0
@@ -207,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
215
  none: false
208
216
  required_rubygems_version: !ruby/object:Gem::Requirement
209
217
  requirements:
210
- - - ! '>='
218
+ - - ">="
211
219
  - !ruby/object:Gem::Version
212
220
  segments:
213
221
  - 0