httpattack-lib 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/httpattack.rb
CHANGED
@@ -39,6 +39,20 @@ module HTTPAttack
|
|
39
39
|
@stats = self.reload_stats(*args)
|
40
40
|
end
|
41
41
|
|
42
|
+
#
|
43
|
+
# Class info methods (some basic defaults).
|
44
|
+
#
|
45
|
+
|
46
|
+
class << self
|
47
|
+
def name
|
48
|
+
self.to_s.split('::').last
|
49
|
+
end
|
50
|
+
|
51
|
+
def desc
|
52
|
+
'A basic item.'
|
53
|
+
end
|
54
|
+
end # self
|
55
|
+
|
42
56
|
end # Base
|
43
57
|
|
44
58
|
end # Items
|
@@ -27,6 +27,13 @@ module HTTPAttack
|
|
27
27
|
URI.parse("http://#{@options[:api_root]}/users/show/#{@username}.json").to_s
|
28
28
|
end
|
29
29
|
|
30
|
+
# Class info methods.
|
31
|
+
class << self
|
32
|
+
def desc
|
33
|
+
'Open Source microblogging software.'
|
34
|
+
end
|
35
|
+
end # self
|
36
|
+
|
30
37
|
end # StatusNet
|
31
38
|
|
32
39
|
end # Items
|
@@ -47,4 +47,14 @@ describe Base do
|
|
47
47
|
@item.stat
|
48
48
|
end.should raise_error(HTTPAttack::Items::MustOverrideMethod)
|
49
49
|
end
|
50
|
+
|
51
|
+
describe 'class info methods' do
|
52
|
+
it 'should have a default name' do
|
53
|
+
Base.name.should == 'Base'
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should have a default description' do
|
57
|
+
Base.desc.should_not be_empty
|
58
|
+
end
|
59
|
+
end
|
50
60
|
end
|