ruckus 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -1,13 +1,18 @@
1
1
  module Ruckus
2
2
  module StructureDetectFactory
3
3
  def factory?
4
- self.respond_to? :factory
4
+ # self.respond_to? :factory
5
+ # self.structure_field_names.try(:has_key?, :decides)
6
+ @factory ||=false
5
7
  end
6
8
 
7
9
  def structure_field_def_hook(*a)
8
10
  args = a[0]
9
11
  opts = args[0].respond_to?(:has_key?) ? args[0] : args[1]
10
- include StructureFactory if opts.try(:has_key?, :decides)
12
+ if opts.try(:has_key?, :decides)
13
+ include StructureFactory
14
+ self.instance_eval{@factory = true}
15
+ end
11
16
  super
12
17
  end
13
18
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruckus}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tduehr", "tqbf"]
12
- s.date = %q{2010-04-16}
12
+ s.date = %q{2010-04-20}
13
13
  s.description = %q{Ruckus: A DOM-Inspired Ruby Smart Fuzzer}
14
14
  s.email = %q{td@matasano.com}
15
15
  s.extra_rdoc_files = [
@@ -85,7 +85,8 @@ Gem::Specification.new do |s|
85
85
  "test/test_decides.rb",
86
86
  "test/test_mutator.rb",
87
87
  "test/test_override.rb",
88
- "test/test_replace.rb"
88
+ "test/test_replace.rb",
89
+ "test/test_respondto.rb"
89
90
  ]
90
91
 
91
92
  if s.respond_to? :specification_version then
@@ -39,12 +39,14 @@ class TestNestedDecide3 < TestSubKlass2
39
39
  end
40
40
 
41
41
  class TestDecides < Test::Unit::TestCase
42
- def test_decides
42
+ def test_parent_class
43
43
  o, s = TestKlass.factory("\000\000\000\001\000\000\000\002\000\000\000\003\000\000\000\004")
44
44
  assert_equal("\000\000\000\003\000\000\000\004",s)
45
45
  assert_equal(TestSubKlass1, o.class)
46
46
  assert_equal(1,o.decider.value)
47
-
47
+ end
48
+
49
+ def test_child_class
48
50
  o, s = TestKlass.factory("\000\000\000\002\000\000\000\002\000\000\000\003\000\000\000\004")
49
51
  assert_equal(TestNestedDecide3, o.class)
50
52
  assert_equal(4, o.ternary_element.value)
@@ -56,6 +58,9 @@ class TestDecides < Test::Unit::TestCase
56
58
  assert_equal(2, tnd2.secondary_element.value)
57
59
  assert_equal(2, tnd2.secondary_decider.value)
58
60
  assert_equal(4, tnd2.ternary_element.value)
61
+ end
62
+
63
+ def test_scope
59
64
  flunk("Scoping issues - fails until test classes can be brought into the TestDecides class' scope")
60
65
  end
61
66
  end
@@ -0,0 +1,18 @@
1
+ require 'test/unit'
2
+ require 'ruckus'
3
+
4
+ class TestRespondTo < Test::Unit::TestCase
5
+ class TestRespondClass < Ruckus::Structure
6
+ n32 :test_element, :value => 1
7
+ tag_bit :tag?, :value => 1
8
+ n32 :tagged_element, :value =>2, :tag => :tagged
9
+ end
10
+
11
+ def test_respond_to?
12
+ trc = TestRespondClass.new
13
+ assert(trc.respond_to?(:test_element))
14
+ assert(trc.respond_to?(:tag?))
15
+ assert(trc.respond_to?(:tagged_element))
16
+ assert(trc.respond_to?(:tagged))
17
+ end
18
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 4
9
- version: 0.5.4
8
+ - 5
9
+ version: 0.5.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - tduehr
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-16 00:00:00 -05:00
18
+ date: 2010-04-20 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -136,3 +136,4 @@ test_files:
136
136
  - test/test_mutator.rb
137
137
  - test/test_override.rb
138
138
  - test/test_replace.rb
139
+ - test/test_respondto.rb