metasploit-model 0.30.2 → 1.0.0.pre.rails.pre.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +4 -2
- data/CONTRIBUTING.md +49 -9
- data/Gemfile +8 -3
- data/lib/metasploit/model.rb +5 -0
- data/lib/metasploit/model/engine.rb +1 -1
- data/lib/metasploit/model/version.rb +14 -26
- data/metasploit-model.gemspec +5 -3
- data/spec/app/models/metasploit/model/association/reflection_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/group/base_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/group/intersection_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/group/union_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/association_spec.rb +9 -7
- data/spec/app/models/metasploit/model/search/operation/base_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/operation/boolean_spec.rb +11 -14
- data/spec/app/models/metasploit/model/search/operation/date_spec.rb +8 -6
- data/spec/app/models/metasploit/model/search/operation/group/base_spec.rb +14 -12
- data/spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/group/union_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/integer_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/null_spec.rb +6 -4
- data/spec/app/models/metasploit/model/search/operation/set/integer_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/set/string_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/set_spec.rb +6 -4
- data/spec/app/models/metasploit/model/search/operation/string_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operator/association_spec.rb +8 -6
- data/spec/app/models/metasploit/model/search/operator/attribute_spec.rb +14 -12
- data/spec/app/models/metasploit/model/search/operator/base_spec.rb +5 -3
- data/spec/app/models/metasploit/model/search/operator/delegation_spec.rb +11 -13
- data/spec/app/models/metasploit/model/search/operator/group/base_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb +5 -3
- data/spec/app/models/metasploit/model/search/operator/group/union_spec.rb +5 -3
- data/spec/app/models/metasploit/model/search/operator/null_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/operator/single_spec.rb +28 -26
- data/spec/app/models/metasploit/model/search/query_spec.rb +50 -48
- data/spec/app/models/metasploit/model/visitation/visitor_spec.rb +9 -7
- data/spec/app/validators/ip_format_validator_spec.rb +9 -7
- data/spec/app/validators/nil_validator_spec.rb +5 -3
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +19 -17
- data/spec/dummy/config/application.rb +3 -1
- data/spec/dummy/config/environments/development.rb +0 -3
- data/spec/lib/metasploit/model/association/error_spec.rb +3 -1
- data/spec/lib/metasploit/model/association_spec.rb +10 -8
- data/spec/lib/metasploit/model/base_spec.rb +5 -3
- data/spec/lib/metasploit/model/engine_spec.rb +11 -48
- data/spec/lib/metasploit/model/file_spec.rb +5 -3
- data/spec/lib/metasploit/model/invalid_spec.rb +9 -7
- data/spec/lib/metasploit/model/login/status_spec.rb +3 -1
- data/spec/lib/metasploit/model/nilify_blanks_spec.rb +13 -11
- data/spec/lib/metasploit/model/realm/key_spec.rb +17 -15
- data/spec/lib/metasploit/model/search/association/tree_spec.rb +5 -3
- data/spec/lib/metasploit/model/search/association_spec.rb +4 -2
- data/spec/lib/metasploit/model/search/attribute_spec.rb +8 -6
- data/spec/lib/metasploit/model/search/operation/value/integer_spec.rb +3 -1
- data/spec/lib/metasploit/model/search/operation/value/string_spec.rb +3 -1
- data/spec/lib/metasploit/model/search/operation_spec.rb +13 -11
- data/spec/lib/metasploit/model/search/operator/help_spec.rb +3 -1
- data/spec/lib/metasploit/model/search/with_spec.rb +9 -7
- data/spec/lib/metasploit/model/search_spec.rb +13 -11
- data/spec/lib/metasploit/model/spec/error_spec.rb +4 -2
- data/spec/lib/metasploit/model/spec/i18n_exception_handler_spec.rb +7 -5
- data/spec/lib/metasploit/model/spec/pathname_collision_spec.rb +6 -4
- data/spec/lib/metasploit/model/spec_spec.rb +7 -9
- data/spec/lib/metasploit/model/translation_spec.rb +12 -10
- data/spec/lib/metasploit/model/version_spec.rb +139 -3
- data/spec/lib/metasploit/model/visitation/visit_spec.rb +26 -28
- data/spec/matchers/validate_nilness_of_spec.rb +2 -0
- data/spec/spec_helper.rb +10 -80
- data/spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb +1 -1
- data/spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb +8 -8
- data/spec/support/shared/examples/metasploit/model/search/operation/value/string.rb +5 -5
- data/spec/support/shared/examples/metasploit/model/search/operator/help.rb +16 -18
- data/spec/support/shared/examples/metasploit/model/translation.rb +4 -4
- data/spec/support/shared/examples/search/query.rb +3 -3
- data/spec/support/shared/examples/search_association.rb +2 -2
- data/spec/support/shared/examples/search_attribute.rb +3 -3
- data/spec/support/shared/examples/search_with.rb +3 -3
- metadata +20 -27
- data/CHANGELOG.md +0 -6
- data/RELEASING.md +0 -86
- data/UPGRADING.md +0 -1
- data/spec/lib/metasploit/model_spec.rb +0 -4
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Association::Tree do
|
2
4
|
context 'expand' do
|
3
5
|
subject(:expand) {
|
4
6
|
described_class.expand(associations)
|
@@ -97,7 +99,7 @@ RSpec.describe Metasploit::Model::Association::Tree do
|
|
97
99
|
nil
|
98
100
|
}
|
99
101
|
|
100
|
-
it {
|
102
|
+
it { should be_nil }
|
101
103
|
end
|
102
104
|
|
103
105
|
context 'without nil' do
|
@@ -309,7 +311,7 @@ RSpec.describe Metasploit::Model::Association::Tree do
|
|
309
311
|
nil
|
310
312
|
}
|
311
313
|
|
312
|
-
it {
|
314
|
+
it { should == [] }
|
313
315
|
end
|
314
316
|
end
|
315
317
|
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Association do
|
2
4
|
subject(:base_class) do
|
3
5
|
described_class = self.described_class
|
4
6
|
|
@@ -54,7 +56,7 @@ RSpec.describe Metasploit::Model::Search::Association do
|
|
54
56
|
|
55
57
|
context 'search_associations' do
|
56
58
|
subject(:search_associations) {
|
57
|
-
base_class.search_associations
|
59
|
+
base_class.search_associations *associations
|
58
60
|
}
|
59
61
|
|
60
62
|
let(:associations) {
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Attribute do
|
2
4
|
subject(:base_class) do
|
3
5
|
described_class = self.described_class
|
4
6
|
|
@@ -24,7 +26,7 @@ RSpec.describe Metasploit::Model::Search::Attribute do
|
|
24
26
|
end
|
25
27
|
|
26
28
|
it 'should call search_with' do
|
27
|
-
|
29
|
+
base_class.should_receive(:search_with).with(
|
28
30
|
Metasploit::Model::Search::Operator::Attribute,
|
29
31
|
hash_including(
|
30
32
|
:attribute => attribute,
|
@@ -38,7 +40,7 @@ RSpec.describe Metasploit::Model::Search::Attribute do
|
|
38
40
|
it 'should be in search_attribute_operator_by_attribute' do
|
39
41
|
# grab operator first since it calls search_attribute and populates search_attribute_operator_by_attribute
|
40
42
|
cached = operator
|
41
|
-
|
43
|
+
base_class.search_with_operator_by_name[attribute].should == cached
|
42
44
|
end
|
43
45
|
|
44
46
|
context 'attribute' do
|
@@ -47,7 +49,7 @@ RSpec.describe Metasploit::Model::Search::Attribute do
|
|
47
49
|
end
|
48
50
|
|
49
51
|
it 'should be the attribute passed to search_attribute' do
|
50
|
-
|
52
|
+
operator_attribute.should == attribute
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -57,7 +59,7 @@ RSpec.describe Metasploit::Model::Search::Attribute do
|
|
57
59
|
end
|
58
60
|
|
59
61
|
it 'should be class on which search_attribute was called' do
|
60
|
-
|
62
|
+
klass.should == base_class
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
@@ -67,7 +69,7 @@ RSpec.describe Metasploit::Model::Search::Attribute do
|
|
67
69
|
end
|
68
70
|
|
69
71
|
it 'should be type passed to search_attribute' do
|
70
|
-
|
72
|
+
operator_type.should == type
|
71
73
|
end
|
72
74
|
end
|
73
75
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Value::Integer do
|
2
4
|
it_should_behave_like 'Metasploit::Model::Search::Operation::Value::Integer' do
|
3
5
|
let(:operation_class) do
|
4
6
|
described_class = self.described_class
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Value::String do
|
2
4
|
it_should_behave_like 'Metasploit::Model::Search::Operation::Value::String' do
|
3
5
|
let(:operation_class) do
|
4
6
|
described_class = self.described_class
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation do
|
2
4
|
context 'parse' do
|
3
5
|
subject(:parse) do
|
4
6
|
described_class.parse(options)
|
@@ -46,8 +48,8 @@ RSpec.describe Metasploit::Model::Search::Operation do
|
|
46
48
|
|
47
49
|
context "with at least one ':' in :formatted_operation" do
|
48
50
|
before(:each) do
|
49
|
-
|
50
|
-
|
51
|
+
query.stub(:parse_operator).with(formatted_operator).and_return(operator)
|
52
|
+
operator.stub(:operate_on).with(formatted_value).and_return(operation)
|
51
53
|
end
|
52
54
|
|
53
55
|
context "with multiple ':' in :formatted_operation" do
|
@@ -56,13 +58,13 @@ RSpec.describe Metasploit::Model::Search::Operation do
|
|
56
58
|
end
|
57
59
|
|
58
60
|
it "should treat portion before first ':' as formatted operator" do
|
59
|
-
|
61
|
+
query.should_receive(:parse_operator).with(formatted_operator)
|
60
62
|
|
61
63
|
parse
|
62
64
|
end
|
63
65
|
|
64
66
|
it "should treat portion after first ':' as formatted value including later ':'" do
|
65
|
-
|
67
|
+
operator.should_receive(:operate_on).with(formatted_value)
|
66
68
|
|
67
69
|
parse
|
68
70
|
end
|
@@ -74,13 +76,13 @@ RSpec.describe Metasploit::Model::Search::Operation do
|
|
74
76
|
end
|
75
77
|
|
76
78
|
it "should use portion before ':' as formatted operator" do
|
77
|
-
|
79
|
+
query.should_receive(:parse_operator).with(formatted_operator)
|
78
80
|
|
79
81
|
parse
|
80
82
|
end
|
81
83
|
|
82
84
|
it "should use portion after ':' as formatted value" do
|
83
|
-
|
85
|
+
operator.should_receive(:operate_on).with(formatted_value)
|
84
86
|
|
85
87
|
parse
|
86
88
|
end
|
@@ -101,17 +103,17 @@ RSpec.describe Metasploit::Model::Search::Operation do
|
|
101
103
|
end
|
102
104
|
|
103
105
|
it "should use entirety as formatted operator" do
|
104
|
-
|
106
|
+
operator.stub(:operate_on).and_return(operation)
|
105
107
|
|
106
|
-
|
108
|
+
query.should_receive(:parse_operator).with(formatted_operator).and_return(operator)
|
107
109
|
|
108
110
|
parse
|
109
111
|
end
|
110
112
|
|
111
113
|
it "should use '' as formatted value instead of nil" do
|
112
|
-
|
114
|
+
query.stub(:parse_operator).and_return(operator)
|
113
115
|
|
114
|
-
|
116
|
+
operator.should_receive(:operate_on).with('')
|
115
117
|
|
116
118
|
parse
|
117
119
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::With do
|
2
4
|
let(:base_class) do
|
3
5
|
described_class = self.described_class
|
4
6
|
|
@@ -35,7 +37,7 @@ RSpec.describe Metasploit::Model::Search::With do
|
|
35
37
|
end
|
36
38
|
|
37
39
|
it 'should pass given options to operator_class.new' do
|
38
|
-
|
40
|
+
operator_class.should_receive(:new).with(
|
39
41
|
hash_including(options)
|
40
42
|
).and_return(operator)
|
41
43
|
|
@@ -43,7 +45,7 @@ RSpec.describe Metasploit::Model::Search::With do
|
|
43
45
|
end
|
44
46
|
|
45
47
|
it 'should merge :klass into options passed to operator.new' do
|
46
|
-
|
48
|
+
operator_class.should_receive(:new).with(
|
47
49
|
hash_including(
|
48
50
|
:klass => base_class
|
49
51
|
)
|
@@ -53,9 +55,9 @@ RSpec.describe Metasploit::Model::Search::With do
|
|
53
55
|
end
|
54
56
|
|
55
57
|
it 'should validate operator' do
|
56
|
-
|
58
|
+
operator_class.stub(:new).and_return(operator)
|
57
59
|
|
58
|
-
|
60
|
+
operator.should_receive(:valid!)
|
59
61
|
|
60
62
|
search_with_operator
|
61
63
|
end
|
@@ -63,7 +65,7 @@ RSpec.describe Metasploit::Model::Search::With do
|
|
63
65
|
it 'should add operator to search_with_operator_by_name' do
|
64
66
|
search_with_operator
|
65
67
|
|
66
|
-
|
68
|
+
base_class.search_with_operator_by_name[operator.name].should == operator
|
67
69
|
end
|
68
70
|
end
|
69
71
|
|
@@ -73,7 +75,7 @@ RSpec.describe Metasploit::Model::Search::With do
|
|
73
75
|
end
|
74
76
|
|
75
77
|
it 'should default to empty Hash' do
|
76
|
-
|
78
|
+
search_with_operator_by_name.should == {}
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search do
|
2
4
|
subject(:base_instance) do
|
3
5
|
base_class.new
|
4
6
|
end
|
@@ -14,9 +16,9 @@ RSpec.describe Metasploit::Model::Search do
|
|
14
16
|
base_class.send(:include, described_class)
|
15
17
|
end
|
16
18
|
|
17
|
-
it {
|
18
|
-
it {
|
19
|
-
it {
|
19
|
+
it { should be_a Metasploit::Model::Search::Association }
|
20
|
+
it { should be_a Metasploit::Model::Search::Attribute }
|
21
|
+
it { should be_a Metasploit::Model::Search::With }
|
20
22
|
|
21
23
|
context 'search_operator_by_name' do
|
22
24
|
subject(:search_operator_by_name) do
|
@@ -43,7 +45,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
43
45
|
end
|
44
46
|
|
45
47
|
it 'should be same as the attribute' do
|
46
|
-
|
48
|
+
name.should == attribute
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
@@ -88,7 +90,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
88
90
|
"#{association}.#{associated_attribute}".to_sym
|
89
91
|
end
|
90
92
|
|
91
|
-
it {
|
93
|
+
it { should be_a Metasploit::Model::Search::Operator::Association }
|
92
94
|
|
93
95
|
context 'association' do
|
94
96
|
subject(:operator_association) do
|
@@ -96,7 +98,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
96
98
|
end
|
97
99
|
|
98
100
|
it 'should be the registered association' do
|
99
|
-
|
101
|
+
operator_association.should == association
|
100
102
|
end
|
101
103
|
end
|
102
104
|
|
@@ -110,7 +112,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
110
112
|
end
|
111
113
|
|
112
114
|
it 'should be operator from associated class' do
|
113
|
-
|
115
|
+
source_operator.should == direct_attribute_operator
|
114
116
|
end
|
115
117
|
end
|
116
118
|
|
@@ -120,7 +122,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
120
122
|
end
|
121
123
|
|
122
124
|
it 'should be class that called search_operator_by_name' do
|
123
|
-
|
125
|
+
klass.should == base_class
|
124
126
|
end
|
125
127
|
end
|
126
128
|
end
|
@@ -153,7 +155,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
153
155
|
end
|
154
156
|
|
155
157
|
it 'should be in search_operator_by_name' do
|
156
|
-
|
158
|
+
named_operator.should == operator
|
157
159
|
end
|
158
160
|
end
|
159
161
|
end
|
@@ -161,7 +163,7 @@ RSpec.describe Metasploit::Model::Search do
|
|
161
163
|
context 'without search attribute' do
|
162
164
|
context 'without search association' do
|
163
165
|
context 'without search with' do
|
164
|
-
it {
|
166
|
+
it { should be_empty }
|
165
167
|
end
|
166
168
|
end
|
167
169
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Spec::I18nExceptionHandler do
|
2
4
|
subject(:i18n_exception_handler) do
|
3
5
|
described_class.new
|
4
6
|
end
|
@@ -30,10 +32,10 @@ RSpec.describe Metasploit::Model::Spec::I18nExceptionHandler do
|
|
30
32
|
expect {
|
31
33
|
call
|
32
34
|
}.to raise_error(converted_exception.class) do |actual_exception|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
actual_exception.class == converted_exception.class
|
36
|
+
actual_exception.key.should == converted_exception.key
|
37
|
+
actual_exception.locale.should == converted_exception.locale
|
38
|
+
actual_exception.options.should == converted_exception.options
|
37
39
|
end
|
38
40
|
end
|
39
41
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Spec::PathnameCollision do
|
2
4
|
let(:pathname) do
|
3
5
|
Metasploit::Model::Spec.temporary_pathname.join('pathname')
|
4
6
|
end
|
@@ -7,7 +9,7 @@ RSpec.describe Metasploit::Model::Spec::PathnameCollision do
|
|
7
9
|
described_class.new(pathname)
|
8
10
|
end
|
9
11
|
|
10
|
-
it {
|
12
|
+
it { should be_a Metasploit::Model::Spec::Error }
|
11
13
|
|
12
14
|
context 'check!' do
|
13
15
|
subject(:check!) do
|
@@ -42,11 +44,11 @@ RSpec.describe Metasploit::Model::Spec::PathnameCollision do
|
|
42
44
|
end
|
43
45
|
|
44
46
|
it 'should include pathname' do
|
45
|
-
|
47
|
+
message.should include("#{pathname} already exists.")
|
46
48
|
end
|
47
49
|
|
48
50
|
it 'should include potential cause' do
|
49
|
-
|
51
|
+
message.should include('Metasploit::Model::Spec.remove_temporary_pathname was not called after the previous spec.')
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Spec do
|
2
4
|
before(:each) do
|
3
5
|
@before_temporary_pathname = described_class.send(:remove_instance_variable, :@temporary_pathname)
|
4
6
|
end
|
@@ -33,11 +35,11 @@ RSpec.describe Metasploit::Model::Spec do
|
|
33
35
|
end
|
34
36
|
|
35
37
|
it 'should remove file tree' do
|
36
|
-
|
38
|
+
pathname.exist?.should be_true
|
37
39
|
|
38
40
|
remove_temporary_pathname
|
39
41
|
|
40
|
-
|
42
|
+
pathname.exist?.should be_false
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
@@ -80,7 +82,7 @@ RSpec.describe Metasploit::Model::Spec do
|
|
80
82
|
end
|
81
83
|
|
82
84
|
it 'should return set pathname' do
|
83
|
-
|
85
|
+
temporary_pathname.should == pathname
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
@@ -105,11 +107,7 @@ RSpec.describe Metasploit::Model::Spec do
|
|
105
107
|
expect {
|
106
108
|
described_class.temporary_pathname = temporary_pathname
|
107
109
|
}.to change {
|
108
|
-
|
109
|
-
described_class.instance_variable_get(:@temporary_pathname)
|
110
|
-
else
|
111
|
-
nil
|
112
|
-
end
|
110
|
+
described_class.instance_variable_get(:@temporary_pathname)
|
113
111
|
}.to(temporary_pathname)
|
114
112
|
end
|
115
113
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Translation do
|
2
4
|
let(:base_class) do
|
3
5
|
described_class = self.described_class
|
4
6
|
|
@@ -54,21 +56,21 @@ RSpec.describe Metasploit::Model::Translation do
|
|
54
56
|
end
|
55
57
|
|
56
58
|
it 'should have named and unnamed ancestors' do
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
base_class.ancestors.should include(named_class)
|
60
|
+
base_class.ancestors.should include(named_module)
|
61
|
+
base_class.ancestors.should include(unnamed_class)
|
62
|
+
base_class.ancestors.should include(unnamed_module)
|
61
63
|
end
|
62
64
|
|
63
65
|
it 'should return all ancestors that respond to model_name' do
|
64
|
-
|
65
|
-
|
66
|
-
|
66
|
+
lookup_ancestors.should include(base_class)
|
67
|
+
lookup_ancestors.should include(named_class)
|
68
|
+
lookup_ancestors.should include(named_module)
|
67
69
|
end
|
68
70
|
|
69
71
|
it 'should not return ancestors that do not respond to model_name' do
|
70
|
-
|
71
|
-
|
72
|
+
lookup_ancestors.should_not include(unnamed_class)
|
73
|
+
lookup_ancestors.should_not include(unnamed_module)
|
72
74
|
end
|
73
75
|
end
|
74
76
|
|