lib/assert/factory.rb in assert-2.8.0 vs lib/assert/factory.rb in assert-2.9.0

- old
+ new

@@ -58,10 +58,16 @@ def file_path self.type_cast(Random.file_path_string, :string) end + alias_method :path, :dir_path + + def url(host = nil, length = nil) + self.type_cast(Random.url_string(host, length), :string) + end + def binary self.type_cast(Random.binary, :binary) end def boolean @@ -132,9 +138,13 @@ File.join(*self.string(length).scan(/.{1,4}/)) end def self.file_path_string File.join(self.dir_path_string, self.file_name_string) + end + + def self.url_string(host = nil, length = nil) + File.join(host.to_s, self.dir_path_string(length)) end def self.binary [ self.integer(10000) ].pack('N*') end