Skip to content
Permalink
Browse files

Merge pull request #563 from jstepien/random-bytes

Partial implementation of Random#bytes
  • Loading branch information
alex committed Mar 30, 2013
2 parents 5033a71 + ffb1670 commit 136a4aa43bd4ecece24248d73f3d487d2ab84471
Showing with 6 additions and 3 deletions.
  1. +1 −0 lib-topaz/bootstrap.rb
  2. +5 −0 lib-topaz/random.rb
  3. +0 −3 spec/tags/core/random/bytes_tags.txt
@@ -19,6 +19,7 @@
load_bootstrap.call("numeric.rb")
load_bootstrap.call("process.rb")
load_bootstrap.call("range.rb")
load_bootstrap.call("random.rb")
load_bootstrap.call("string.rb")
load_bootstrap.call("symbol.rb")
load_bootstrap.call("top_self.rb")
@@ -0,0 +1,5 @@
class Random
def bytes(n)
n.times.map { rand(256).chr } .join
end
end
@@ -1,7 +1,4 @@
fails:Random#bytes returns a String
fails:Random#bytes returns a String of the length given as argument
fails:Random#bytes returns an ASCII-8BIT String
fails:Random#bytes returns the same output for a given seed
fails:Random#bytes returns the same numeric output for a given seed accross all implementations and platforms
fails:Random#bytes returns the same numeric output for a given huge seed accross all implementations and platforms
fails:Random#bytes returns a random binary String

0 comments on commit 136a4aa

Please sign in to comment.