Class: Jfuzz::SchemaFuzzer

Inherits:
Object
  • Object
show all
Defined in:
lib/jfuzz/schema_fuzzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(schema_path) ⇒ SchemaFuzzer



8
9
10
11
# File 'lib/jfuzz/schema_fuzzer.rb', line 8

def initialize(schema_path)
  @schema_path = schema_path
  @property_fuzzer = PropertyFuzzer.new
end

Instance Method Details

#fuzzObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/jfuzz/schema_fuzzer.rb', line 13

def fuzz
  if schema_path.to_s.nil?
    raise "Schema path cannot be nil or empty"
  end

  schema_contents = File.read(schema_path)
  schema = JSON.parse(schema_contents)

  property_fuzzer.fuzz_property(schema)
end