simplabs-excellent 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,22 +9,22 @@ describe Simplabs::Excellent::Checks::Rails::AttrAccessibleCheck do
9
9
  describe '#evaluate' do
10
10
 
11
11
  it 'should ignore classes that are not active record models' do
12
- content = <<-END
12
+ code = <<-END
13
13
  class Test
14
14
  end
15
15
  END
16
- @excellent.check_content(content)
16
+ @excellent.check_code(code)
17
17
  warnings = @excellent.warnings
18
18
 
19
19
  warnings.should be_empty
20
20
  end
21
21
 
22
22
  it 'should reject an active record model that does not specify attr_accessible' do
23
- content = <<-END
23
+ code = <<-END
24
24
  class User < ActiveRecord::Base
25
25
  end
26
26
  END
27
- @excellent.check_content(content)
27
+ @excellent.check_code(code)
28
28
  warnings = @excellent.warnings
29
29
 
30
30
  warnings.should_not be_empty
@@ -34,12 +34,12 @@ describe Simplabs::Excellent::Checks::Rails::AttrAccessibleCheck do
34
34
  end
35
35
 
36
36
  it 'should reject an active record model that does specify attr_protected' do
37
- content = <<-END
37
+ code = <<-END
38
38
  class User < ActiveRecord::Base
39
39
  attr_protected :first_name
40
40
  end
41
41
  END
42
- @excellent.check_content(content)
42
+ @excellent.check_code(code)
43
43
  warnings = @excellent.warnings
44
44
 
45
45
  warnings.should_not be_empty
@@ -49,23 +49,23 @@ describe Simplabs::Excellent::Checks::Rails::AttrAccessibleCheck do
49
49
  end
50
50
 
51
51
  it 'should accept an active record model that does specify attr_accessible' do
52
- content = <<-END
52
+ code = <<-END
53
53
  class User < ActiveRecord::Base
54
54
  attr_accessible :first_name
55
55
  end
56
56
  END
57
- @excellent.check_content(content)
57
+ @excellent.check_code(code)
58
58
  warnings = @excellent.warnings
59
59
 
60
60
  warnings.should be_empty
61
61
  end
62
62
 
63
63
  it 'should also work with namespaced models' do
64
- content = <<-END
64
+ code = <<-END
65
65
  class Backend::User < ActiveRecord::Base
66
66
  end
67
67
  END
68
- @excellent.check_content(content)
68
+ @excellent.check_code(code)
69
69
  warnings = @excellent.warnings
70
70
 
71
71
  warnings.should_not be_empty
@@ -9,23 +9,23 @@ describe Simplabs::Excellent::Checks::Rails::AttrProtectedCheck do
9
9
  describe '#evaluate' do
10
10
 
11
11
  it 'should ignore classes that are not active record models' do
12
- content = <<-END
12
+ code = <<-END
13
13
  class Test
14
14
  end
15
15
  END
16
- @excellent.check_content(content)
16
+ @excellent.check_code(code)
17
17
  warnings = @excellent.warnings
18
18
 
19
19
  warnings.should be_empty
20
20
  end
21
21
 
22
22
  it 'should reject an active record model that does specify attr_protected' do
23
- content = <<-END
23
+ code = <<-END
24
24
  class User < ActiveRecord::Base
25
25
  attr_protected :first_name
26
26
  end
27
27
  END
28
- @excellent.check_content(content)
28
+ @excellent.check_code(code)
29
29
  warnings = @excellent.warnings
30
30
 
31
31
  warnings.should_not be_empty
@@ -35,35 +35,35 @@ describe Simplabs::Excellent::Checks::Rails::AttrProtectedCheck do
35
35
  end
36
36
 
37
37
  it 'should accept an active record model that does specify attr_accessible' do
38
- content = <<-END
38
+ code = <<-END
39
39
  class User < ActiveRecord::Base
40
40
  attr_accessible :first_name
41
41
  end
42
42
  END
43
- @excellent.check_content(content)
43
+ @excellent.check_code(code)
44
44
  warnings = @excellent.warnings
45
45
 
46
46
  warnings.should be_empty
47
47
  end
48
48
 
49
49
  it 'should accept an active record model that specifies neither attr_accessible not attr_protected' do
50
- content = <<-END
50
+ code = <<-END
51
51
  class User < ActiveRecord::Base
52
52
  end
53
53
  END
54
- @excellent.check_content(content)
54
+ @excellent.check_code(code)
55
55
  warnings = @excellent.warnings
56
56
 
57
57
  warnings.should be_empty
58
58
  end
59
59
 
60
60
  it 'should also work with namespaced models' do
61
- content = <<-END
61
+ code = <<-END
62
62
  class Backend::User < ActiveRecord::Base
63
63
  attr_protected :first_name
64
64
  end
65
65
  END
66
- @excellent.check_content(content)
66
+ @excellent.check_code(code)
67
67
  warnings = @excellent.warnings
68
68
 
69
69
  warnings.should_not be_empty
@@ -9,10 +9,10 @@ describe Simplabs::Excellent::Checks::SingletonVariableCheck do
9
9
  describe '#evaluate' do
10
10
 
11
11
  it 'should reject singleton variables' do
12
- content = <<-END
12
+ code = <<-END
13
13
  @@foo
14
14
  END
15
- @excellent.check_content(content)
15
+ @excellent.check_code(code)
16
16
  warnings = @excellent.warnings
17
17
 
18
18
  warnings.should_not be_empty
@@ -22,7 +22,7 @@ describe Simplabs::Excellent::Checks::SingletonVariableCheck do
22
22
  end
23
23
 
24
24
  it 'should also work for namespaced classes' do
25
- content = <<-END
25
+ code = <<-END
26
26
  module Outer
27
27
  module Inner
28
28
  class Class
@@ -31,7 +31,7 @@ describe Simplabs::Excellent::Checks::SingletonVariableCheck do
31
31
  end
32
32
  end
33
33
  END
34
- @excellent.check_content(content)
34
+ @excellent.check_code(code)
35
35
  warnings = @excellent.warnings
36
36
 
37
37
  warnings.should_not be_empty
@@ -41,7 +41,7 @@ describe Simplabs::Excellent::Checks::SingletonVariableCheck do
41
41
  end
42
42
 
43
43
  it 'should also work for singleton variables that occur within methods' do
44
- content = <<-END
44
+ code = <<-END
45
45
  module Outer
46
46
  module Inner
47
47
  class Class
@@ -52,7 +52,7 @@ describe Simplabs::Excellent::Checks::SingletonVariableCheck do
52
52
  end
53
53
  end
54
54
  END
55
- @excellent.check_content(content)
55
+ @excellent.check_code(code)
56
56
  warnings = @excellent.warnings
57
57
 
58
58
  warnings.should_not be_empty
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplabs-excellent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Otte-Witte