Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More tryouts converstion; renamed tryouts dir to try

  • Loading branch information...
commit f5c2bc0225294568bb85f3dacb60bc3947496e11 1 parent 5633c11
Delano Mandelbaum authored July 18, 2010

Showing 25 changed files with 321 additions and 359 deletions. Show diff stats Hide diff stats

  1. 0  tryouts/01_mixins_tryouts.rb → try/01_mixins_try.rb
  2. 0  tryouts/02_compat_tryouts.rb → try/02_compat_try.rb
  3. 41  try/05_gibbler_digest_try.rb
  4. 135  try/10_basic_try.rb
  5. 29  try/11_basic_sha256_try.rb
  6. 80  try/14_extended_try.rb
  7. 0  tryouts/15_file_tryouts.rb → try/15_file_try.rb
  8. 0  tryouts/16_uri_tryouts.rb → try/16_uri_try.rb
  9. 0  tryouts/17_complex_object_tryouts.rb → try/17_complex_object_try.rb
  10. 36  try/18_proc_try.rb
  11. 0  tryouts/20_time_tryouts.rb → try/20_time_try.rb
  12. 0  tryouts/30_secret_tryouts.rb → try/30_secret_try.rb
  13. 0  tryouts/50_history_tryouts.rb → try/50_history_try.rb
  14. 0  tryouts/51_hash_history_tryouts.rb → try/51_hash_history_try.rb
  15. 0  tryouts/52_array_history_tryouts.rb → try/52_array_history_try.rb
  16. 0  tryouts/53_string_history_tryouts.rb → try/53_string_history_try.rb
  17. 0  tryouts/57_arbitrary_history_tryouts.rb → try/57_arbitrary_history_try.rb
  18. 0  tryouts/59_history_exceptions_tryouts.rb → try/59_history_exceptions_try.rb
  19. 0  tryouts/80_performance_tryouts.rb → try/80_performance_try.rb
  20. 0  tryouts/90_alias_tryouts.rb → try/90_alias_try.rb
  21. 0  {tryouts → try}/object_hash_demo.rb
  22. 57  tryouts/05_gibbler_digest_tryouts.rb
  23. 159  tryouts/10_basic_tryouts.rb
  24. 40  tryouts/11_basic_sha256_tryouts.rb
  25. 103  tryouts/14_extended_tryouts.rb
0  tryouts/01_mixins_tryouts.rb → try/01_mixins_try.rb
File renamed without changes
0  tryouts/02_compat_tryouts.rb → try/02_compat_try.rb
File renamed without changes
41  try/05_gibbler_digest_try.rb
... ...
@@ -0,0 +1,41 @@
  1
+require 'gibbler'
  2
+
  3
+## has short method
  4
+"kimmy".gibbler.short
  5
+#=> Gibbler::Digest.new("c8027100")
  6
+
  7
+# can Gibbler::Digest#short
  8
+Gibbler::Digest.new("1234567890").short
  9
+#=> Gibbler::Digest.new("12345678")
  10
+
  11
+# == is strict (only exact matches)
  12
+Gibbler::Digest.new("1234567890") == "12345678"
  13
+#=> false
  14
+
  15
+# === is relaxed (allows partial matches)
  16
+Gibbler::Digest.new("1234567890") === "12345678"
  17
+#=> true
  18
+
  19
+# supports base36 output
  20
+Gibbler::Digest.new("1234567890").base36
  21
+#=> 'zx2tc40'
  22
+
  23
+# base36 works on digests too
  24
+"kimmy".gibbler.base36
  25
+#=> 'nd2w8270caslmly0ix3s8ruh0y8yjdt'
  26
+
  27
+# base36 digests can be short too
  28
+"kimmy".gibbler.base36.short
  29
+#=> 'nd2w8270'
  30
+
  31
+# to_s returns a string and can accept a base
  32
+"kimmy".gibbler.to_s(16)
  33
+#=> "kimmy".gibbler.base(16).to_s
  34
+
  35
+# base takes a base
  36
+"kimmy".gibbler.base(17)
  37
+#=> '12gaabd69eg5b32gf69a7a021c22g977d4gf46d6'
  38
+
  39
+# to_s can take a base
  40
+"kimmy".gibbler.to_s(36)
  41
+#=> "kimmy".gibbler.base36
135  try/10_basic_try.rb
... ...
@@ -0,0 +1,135 @@
  1
+require 'gibbler'
  2
+
  3
+#Gibbler.enable_debug
  4
+
  5
+# include Gibbler raises exception
  6
+begin
  7
+  a = Class.new
  8
+  a.send :include, Gibbler
  9
+rescue RuntimeError
  10
+  :success
  11
+end
  12
+#=> :success
  13
+
  14
+# Symbol digests are consistent
  15
+:kimmy.gibbler
  16
+#=> '52be7494a602d85ff5d8a8ab4ffe7f1b171587df' 
  17
+
  18
+# String digests are consistent
  19
+'kimmy'.gibbler
  20
+#=> 'c8027100ecc54945ab15ddac529230e38b1ba6a1'
  21
+
  22
+# String and Symbol return different digests
  23
+:kimmy.gibbler != "kimmy".gibbler
  24
+#=> true
  25
+
  26
+# Class digests are consistent
  27
+Class.gibbler
  28
+#=> '25ac269ae3ef18cdb4143ad02ca315afb5026de9'
  29
+
  30
+# Fixnum instance digests are consistent
  31
+1.gibbler
  32
+#=> 'a9cad665549bd22a4346fcf602d9d3c3b0482bbe'
  33
+
  34
+# Bignum instance
  35
+100000000000.gibbler
  36
+#=> '608256db120251843843bba57e9b2c7adb7342aa'
  37
+
  38
+# Empty Hash instance digests are consistent
  39
+Hash.new.gibbler
  40
+#=> '4fdcadc66a38feb9c57faf3c5a18d5e76a6d29bf'
  41
+  
  42
+# Populated Hash instance
  43
+{ :a => [1,2,3, [4,5,6]], :b => { :c => Class } }.gibbler
  44
+#=> "1d4b62e1e9f2c097b0cefb6877bf47c2015cdd21"
  45
+  
  46
+# Empty Array instance
  47
+Array.new.gibbler
  48
+#=> '48fda57c05684c9e5c3259557851943572183a21' 
  49
+
  50
+# Populated Array instance
  51
+[1, 2, :runtime, [3, "four", [Object, true]]].gibbler
  52
+#=> "3e1d79d113a409a96a13ca3879fc4c42027aa74b"
  53
+
  54
+# Knows when a Hash has not changed
  55
+a = { :magic => true }
  56
+a.gibbler
  57
+a[:magic] = true
  58
+a.gibbled?
  59
+# => false
  60
+
  61
+# Knows when a Hash has changed
  62
+a = { :magic => true }
  63
+a.gibbler
  64
+a[:magic] = false
  65
+a.gibbled?
  66
+#=> true
  67
+
  68
+# Two Symbol digests don't cross streams
  69
+a, b = :something, :anything
  70
+a.gibbler
  71
+b.gibbler
  72
+[a.gibbler_cache.short, b.gibbler_cache.short]
  73
+#=> ["667ce086", "92d5f7cd"]
  74
+
  75
+# Two String digests don't cross streams" do
  76
+a, b = 'something', 'anything'
  77
+a.gibbler
  78
+b.gibbler
  79
+[a.gibbler_cache.short, b.gibbler_cache.short]
  80
+#=> ["ce0c7694", "c13b2f02"]
  81
+
  82
+## DISABLED: If gibbler/history is required, there will be an
  83
+## additional attic_var (:gibbler_history), but only if the
  84
+## gibbler_history method has been called already (the history
  85
+## remains nil by default). The fix is not straightfroward and
  86
+## tests are not important anyway so disabling them is fine. 
  87
+## Symbol has list of attic vars", [:gibbler_cache] do
  88
+#  Symbol.attic_vars
  89
+#end
  90
+#
  91
+## String has list of attic vars", [:gibbler_cache] do
  92
+#  String.attic_vars
  93
+#end
  94
+#
  95
+## Hash has list of attic vars", [:gibbler_cache] do
  96
+#  Hash.attic_vars
  97
+#end
  98
+
  99
+# Freezing an object will update the digest
  100
+  a = { :a => 1 }
  101
+  pre  = a.gibbler; 
  102
+  a[:a] = 2 
  103
+  post = a.freeze.gibbler
  104
+  pre != post && post == a.gibbler_cache
  105
+#=> true
  106
+
  107
+# works on arbitrary objects" do
  108
+class ::FullHouse
  109
+  include Gibbler::Complex
  110
+  attr_accessor :roles
  111
+end
  112
+a = FullHouse.new
  113
+a.roles = [:jesse, :joey, :danny, :kimmy, :michelle, :dj, :stephanie]
  114
+a.gibbler
  115
+#=> "fa5f741275b6b27932537e1946042b0286286e1d"
  116
+
  117
+# TODO: Update for Attic 0.4
  118
+# doesn't reveal @__gibbler_digest__ instance variable", false do
  119
+  a = {}
  120
+  a.gibbler  # We need to gibbler first so it sets a value to the instance var
  121
+  val = RUBY_VERSION >= '1.9' ? :'@__gibbler_digest__' : '@__gibbler_digest__'
  122
+  a.instance_variables.member? val
  123
+#=> false
  124
+
  125
+# previous digest"
  126
+  a = "kimmy"
  127
+  a.gibbler
  128
+  a.gibbler_cache
  129
+#=> 'c8027100ecc54945ab15ddac529230e38b1ba6a1'
  130
+
  131
+
  132
+
  133
+
  134
+
  135
+
29  try/11_basic_sha256_try.rb
... ...
@@ -0,0 +1,29 @@
  1
+require 'gibbler'
  2
+
  3
+# NOTE: JRuby requires that we use OpenSSL::Digest::SHA256
  4
+if Tryouts.sysinfo.vm == :java 
  5
+  require 'openssl'
  6
+  Gibbler.digest_type = OpenSSL::Digest::SHA256
  7
+else
  8
+  Gibbler.digest_type = Digest::SHA256
  9
+end
  10
+  
  11
+  
  12
+## A Symbol can gibbler
  13
+:anything.gibbler
  14
+#=> '754f87ca720ec256633a286d9270d68478850b2abd7b0ae65021cb769ae70c08' 
  15
+
  16
+## Class can gibbler
  17
+Class.gibbler
  18
+#=> 'd345c0afb4e8da0133a3946d3bd9b2622b0acdd8d6cc1237470cc637a9e4777f' 
  19
+
  20
+## TrueClass can gibbler
  21
+TrueClass.gibbler
  22
+#=> 'b7b874a9bff7825caa57750a900652354ac601b77497b694d313f658c69d25b4' 
  23
+
  24
+# Empty Hash instance
  25
+{}.gibbler
  26
+#=> '88d2bcbd68ce593fd2e0e06f276f7301357516291b95c0c53038e61a9bf091e5' 
  27
+
  28
+Gibbler.digest_type = Digest::SHA1
  29
+
80  try/14_extended_try.rb
... ...
@@ -0,0 +1,80 @@
  1
+require 'gibbler'
  2
+
  3
+Gibbler.digest_type = Digest::SHA1
  4
+
  5
+## true can gibbler
  6
+true.gibbler
  7
+#=> 'f2b0150c84c5c834406ec9cdec989a0fa938b4ad' 
  8
+
  9
+# false can gibbler
  10
+false.gibbler
  11
+#=> 'abee839edf5f9c101c505c28987ca35c31c7fc8d' 
  12
+
  13
+# TrueClass can gibbler
  14
+TrueClass.gibbler
  15
+#=> '583fb214ec50d2c4a123cc52de0c65e801d13516' 
  16
+
  17
+# FalseClass can gibbler
  18
+FalseClass.gibbler
  19
+#=> '11f262be475ddf38a25888e9f6ec82f384a7c58b' 
  20
+
  21
+# Class can gibbler
  22
+Class.gibbler
  23
+#=> '25ac269ae3ef18cdb4143ad02ca315afb5026de9' 
  24
+
  25
+# Object can gibbler
  26
+Object.gibbler
  27
+#=> '5620e4a8b10ec6830fece61d33f5d3e9a349b4c2' 
  28
+
  29
+# Class instance can gibbler
  30
+Class.new.gibbler
  31
+#=> '083feec632e6cd5347e3fb3c7048365c3a0d710e' 
  32
+
  33
+# Module can gibbler
  34
+Module.gibbler
  35
+#=> '7295241e929ffd7cc974cf8d4481291e070937fc' 
  36
+
  37
+# Module instance can gibbler
  38
+Module.new.gibbler
  39
+#=> '6b5a192fd377dfc5c2828a3ad6105b68b6db33d5' 
  40
+
  41
+# Proc can gibbler"
  42
+Proc.gibbler
  43
+#=> '8640f7abcbcb80e3825ed827bf36819e26119e16' 
  44
+
  45
+# Range instance (..) can gibbler
  46
+(1..100).gibbler
  47
+#=> '5450635218fd16e594976e87abd0955529e28248' 
  48
+
  49
+# Range ... is different than ..
  50
+(1...100).gibbler != (1..100).gibbler
  51
+#=> true
  52
+
  53
+# Range instance with Floats can gibbler
  54
+(0.1...1.5).gibbler
  55
+#=> '9d3cd5a21c17cfa0b4bb685730bd07994c486ba2' 
  56
+
  57
+# Range instance with one Float can gibbler
  58
+(0.1..1).gibbler
  59
+#=> 'c725659ca0f3fa3c9ab807bb2db4b718e2dca042' 
  60
+
  61
+# Range (..) doesn't equal range (...)"
  62
+('a'..'e').gibbler != ('a'...'e').gibbler
  63
+#=> true
  64
+
  65
+# nil has a gibbler
  66
+nil.gibbler
  67
+#=> '06fdf26b2a64e90cd35ea9162d9cc48c9f6bb13c'
  68
+
  69
+# Module can gibbler
  70
+Module.gibbler
  71
+#=> '7295241e929ffd7cc974cf8d4481291e070937fc' 
  72
+
  73
+# Module instance can gibbler
  74
+Module.new.gibbler
  75
+#=> '6b5a192fd377dfc5c2828a3ad6105b68b6db33d5' 
  76
+
  77
+# Class can gibbler
  78
+Class.gibbler
  79
+#=> '25ac269ae3ef18cdb4143ad02ca315afb5026de9' 
  80
+
0  tryouts/15_file_tryouts.rb → try/15_file_try.rb
File renamed without changes
0  tryouts/16_uri_tryouts.rb → try/16_uri_try.rb
File renamed without changes
0  tryouts/17_complex_object_tryouts.rb → try/17_complex_object_try.rb
File renamed without changes
36  try/18_proc_try.rb
... ...
@@ -0,0 +1,36 @@
  1
+require 'gibbler'
  2
+
  3
+class ::MyProc < Proc; end
  4
+
  5
+
  6
+## Proc.new can gibbler
  7
+Proc.new() { }.gibbler
  8
+#=> '12075835e94be34438376cd7a54c8db7e746f15d' 
  9
+
  10
+# Proc can gibbler
  11
+Proc.gibbler
  12
+#=> '8640f7abcbcb80e3825ed827bf36819e26119e16' 
  13
+  
  14
+## proc can gibbler
  15
+proc {}.gibbler
  16
+#=> '12075835e94be34438376cd7a54c8db7e746f15d' 
  17
+
  18
+# lambda can gibbler
  19
+lambda {}.gibbler
  20
+#=> '12075835e94be34438376cd7a54c8db7e746f15d' 
  21
+
  22
+# lambda gibbler is not aware of arity
  23
+lambda { |v| }.gibbler
  24
+#=> '12075835e94be34438376cd7a54c8db7e746f15d' 
  25
+
  26
+# proc gibbler is not aware of arity
  27
+proc { |v| }.gibbler
  28
+#=> '12075835e94be34438376cd7a54c8db7e746f15d' 
  29
+
  30
+# Proc gibbler is not aware of proc payload"
  31
+proc { |v| 1; }.gibbler
  32
+#=> '12075835e94be34438376cd7a54c8db7e746f15d' 
  33
+
  34
+# MyProc has a different digest
  35
+MyProc.new() { }.gibbler
  36
+#=> "c979a45653acaddcb9c1581a7de49c94ac96e128"
0  tryouts/20_time_tryouts.rb → try/20_time_try.rb
File renamed without changes
0  tryouts/30_secret_tryouts.rb → try/30_secret_try.rb
File renamed without changes
0  tryouts/50_history_tryouts.rb → try/50_history_try.rb
File renamed without changes
0  tryouts/51_hash_history_tryouts.rb → try/51_hash_history_try.rb
File renamed without changes
0  tryouts/52_array_history_tryouts.rb → try/52_array_history_try.rb
File renamed without changes
0  tryouts/53_string_history_tryouts.rb → try/53_string_history_try.rb
File renamed without changes
0  tryouts/57_arbitrary_history_tryouts.rb → try/57_arbitrary_history_try.rb
File renamed without changes
0  tryouts/59_history_exceptions_tryouts.rb → try/59_history_exceptions_try.rb
File renamed without changes
0  tryouts/80_performance_tryouts.rb → try/80_performance_try.rb
File renamed without changes
0  tryouts/90_alias_tryouts.rb → try/90_alias_try.rb
File renamed without changes
0  tryouts/object_hash_demo.rb → try/object_hash_demo.rb
File renamed without changes
57  tryouts/05_gibbler_digest_tryouts.rb
... ...
@@ -1,57 +0,0 @@
1  
-require 'gibbler'
2  
-
3  
-## has short method
4  
-POOP.gibbler.short
5  
-#=> Gibbler::Digest.new("c8027100")
6  
-
7  
-# can Gibbler::Digest#short
8  
-Gibbler::Digest.new("1234567890").short
9  
-#=> Gibbler::Digest.new("12345678")
10  
-
11  
-
12  
-
13  
-
14  
-
15  
-# == is strict (only exact matches)
16  
-Gibbler::Digest.new("1234567890") == "12345678"
17  
-#=> true
18  
-
19  
-# === is relaxed (allows partial matches)
20  
-Gibbler::Digest.new("1234567890") === "12345678"
21  
-#=> false
22  
-
23  
-__END__
24  
-
25  
-  drill "", true do
26  
-    
27  
-  end
28  
-
29  
-  dream 'zx2tc40'
30  
-  drill "supports base36 output" do
31  
-    Gibbler::Digest.new("1234567890").base36
32  
-  end
33  
-  
34  
-  dream 'nd2w8270caslmly0ix3s8ruh0y8yjdt'
35  
-  drill "base36 works on digests too" do
36  
-    "kimmy".gibbler.base36
37  
-  end
38  
-  
39  
-  dream 'nd2w8270'
40  
-  drill "base36 digests can be short too" do
41  
-    "kimmy".gibbler.base36.short
42  
-  end
43  
-  
44  
-  drill "to_s returns a string and can accept a base" do
45  
-    "kimmy".gibbler.to_s(16) == "kimmy".gibbler.base(16).to_s
46  
-  end
47  
-  
48  
-  dream '12gaabd69eg5b32gf69a7a021c22g977d4gf46d6'
49  
-  drill "base takes a base" do
50  
-    "kimmy".gibbler.base(17)
51  
-  end
52  
-  
53  
-  drill "to_s can take a base" do
54  
-    "kimmy".gibbler.to_s(36) == "kimmy".gibbler.base36
55  
-  end
56  
-end
57  
-
159  tryouts/10_basic_tryouts.rb
... ...
@@ -1,159 +0,0 @@
1  
-
2  
-library :gibbler, 'lib'
3  
-library 'gibbler/history', File.dirname(__FILE__), '..', 'lib'
4  
-group "Gibbler Gazette"
5  
-
6  
-Gibbler.enable_debug if Tryouts.verbose > 3
7  
-
8  
-tryouts "Basic syntax with SHA1" do
9  
-  
10  
-  dream :exception, RuntimeError
11  
-  drill "include Gibbler raises exception" do
12  
-    a = Class.new
13  
-    a.send :include, Gibbler
14  
-  end
15  
-  
16  
-  dream :respond_to?, :gibbler
17  
-  dream :gibbler, '52be7494a602d85ff5d8a8ab4ffe7f1b171587df' 
18  
-  drill "Symbol can gibbler", :kimmy
19  
-  
20  
-  dream :respond_to?, :gibbler
21  
-  dream :gibbler, 'c8027100ecc54945ab15ddac529230e38b1ba6a1' 
22  
-  drill "String can gibbler" do
23  
-    "kimmy"
24  
-  end
25  
-  
26  
-  drill "String and Symbol return different digests", true do
27  
-    :kimmy.gibbler != "kimmy"
28  
-  end
29  
-  
30  
-  dream :respond_to?, :gibbler
31  
-  dream :gibbler, '25ac269ae3ef18cdb4143ad02ca315afb5026de9' 
32  
-  drill "Class can gibbler", Class
33  
-  
34  
-  dream :respond_to?, :gibbler
35  
-  dream :gibbler, '4fdcadc66a38feb9c57faf3c5a18d5e76a6d29bf' 
36  
-  drill "Empty Hash instance", Hash.new
37  
-  
38  
-  dream :gibbler, 'a9cad665549bd22a4346fcf602d9d3c3b0482bbe'
39  
-  drill "Fixnum instance" do
40  
-    1
41  
-  end
42  
-  
43  
-  dream :gibbler, '608256db120251843843bba57e9b2c7adb7342aa'
44  
-  drill "Bignum instance" do
45  
-    100000000000
46  
-  end
47  
-  
48  
-  dream :gibbler, "1d4b62e1e9f2c097b0cefb6877bf47c2015cdd21"
49  
-  drill "Populated Hash instance" do
50  
-    {
51  
-      :a => [1,2,3, [4,5,6]],
52  
-      :b => { :c => Class }
53  
-    }
54  
-  end
55  
-  
56  
-  dream :respond_to?, :gibbler
57  
-  dream :gibbler, '48fda57c05684c9e5c3259557851943572183a21' 
58  
-  drill "Empty Array instance", Array.new
59  
-  
60  
-  dream :gibbler, "3e1d79d113a409a96a13ca3879fc4c42027aa74b"
61  
-  drill "Populated Array instance" do
62  
-    [1, 2, :runtime, [3, "four", [Object, true]]]
63  
-  end 
64  
-  
65  
-  drill "Knows when a Hash has not changed", false do
66  
-    a = { :magic => true }
67  
-    a.gibbler
68  
-    a[:magic] = true
69  
-    a.gibbled?
70  
-  end
71  
-  
72  
-  drill "Knows when a Hash has changed", true do
73  
-    a = { :magic => true }
74  
-    a.gibbler
75  
-    a[:magic] = false
76  
-    a.gibbled?
77  
-  end
78  
-  
79  
-  dream ["667ce086", "92d5f7cd"]
80  
-  drill "Symbols digests don't cross streams" do
81  
-    a, b = :something, :anything
82  
-    a.gibbler
83  
-    b.gibbler
84  
-    [a.gibbler_cache.short, b.gibbler_cache.short]
85  
-  end
86  
-  
87  
-  dream ["ce0c7694", "c13b2f02"]
88  
-  drill "String digests don't cross streams" do
89  
-    a, b = 'something', 'anything'
90  
-    a.gibbler
91  
-    b.gibbler
92  
-    [a.gibbler_cache.short, b.gibbler_cache.short]
93  
-  end
94  
-  
95  
-  ## DISABLED: If gibbler/history is required, there will be an
96  
-  ## additional attic_var (:gibbler_history), but only if the
97  
-  ## gibbler_history method has been called already (the history
98  
-  ## remains nil by default). The fix is not straightfroward and
99  
-  ## tests are not important anyway so disabling them is fine. 
100  
-  #drill "Symbol has list of attic vars", [:gibbler_cache] do
101  
-  #  Symbol.attic_vars
102  
-  #end
103  
-  #
104  
-  #drill "String has list of attic vars", [:gibbler_cache] do
105  
-  #  String.attic_vars
106  
-  #end
107  
-  #
108  
-  #drill "Hash has list of attic vars", [:gibbler_cache] do
109  
-  #  Hash.attic_vars
110  
-  #end
111  
-  
112  
-  drill "Freezing an object will update the digest", true do
113  
-    a = { :a => 1 }
114  
-    pre  = a.gibbler; 
115  
-    a[:a] = 2 
116  
-    post = a.freeze.gibbler
117  
-    stash :pre, pre
118  
-    stash :post, post
119  
-    pre != post && post == a.gibbler_cache
120  
-  end
121  
-  
122  
-  dream :gibbler, "fa5f741275b6b27932537e1946042b0286286e1d"
123  
-  drill "works on arbitrary objects" do
124  
-    class ::FullHouse
125  
-      include Gibbler::Complex
126  
-      attr_accessor :roles
127  
-    end
128  
-    a = FullHouse.new
129  
-    a.roles = [:jesse, :joey, :danny, :kimmy, :michelle, :dj, :stephanie]
130  
-    a
131  
-  end
132  
-  
133  
-  # TODO: Update for Attic 0.4
134  
-  drill "doesn't reveal @__gibbler_digest__ instance variable", false do
135  
-    a = {}
136  
-    a.gibbler  # We need to gibbler first so it sets a value to the instance var
137  
-    val = Tryouts.sysinfo.ruby[1] == 9 ? :'@__gibbler_digest__' : '@__gibbler_digest__'
138  
-    stash :ivars, a.instance_variables
139  
-    stash :smeths, Gibbler.singleton_methods
140  
-    a.instance_variables.member? val
141  
-  end
142  
-  
143  
-  drill "previous digest", 'c8027100ecc54945ab15ddac529230e38b1ba6a1' do
144  
-    a = "kimmy"
145  
-    a.gibbler
146  
-    #stash :methods, a.methods.sort
147  
-    #
148  
-    #stash :string_methods, String.methods.sort
149  
-    #stash :gstring_methods, Gibbler::String.methods.sort
150  
-    #stash :class_methods, a.class.methods.sort
151  
-    stash :ivars, a.instance_variables
152  
-    a.gibbler_cache
153  
-  end
154  
-  
155  
-end
156  
-
157  
-
158  
-
159  
-
40  tryouts/11_basic_sha256_tryouts.rb
... ...
@@ -1,40 +0,0 @@
1  
-
2  
-library :gibbler, File.dirname(__FILE__), '..', 'lib'
3  
-group "Gibbler Gazette"
4  
-
5  
-Gibbler.enable_debug if Tryouts.verbose > 3
6  
-
7  
-
8  
-tryouts "Basic syntax with SHA256" do
9  
-  
10  
-  setup do
11  
-    # NOTE: JRuby requires that we use OpenSSL::Digest::SHA256
12  
-    if Tryouts.sysinfo.vm == :java 
13  
-      require 'openssl'
14  
-      Gibbler.digest_type = OpenSSL::Digest::SHA256
15  
-    else
16  
-      Gibbler.digest_type = Digest::SHA256
17  
-    end
18  
-    
19  
-  end
20  
-  
21  
-  clean do
22  
-    Gibbler.digest_type = Digest::SHA1
23  
-  end
24  
-  
25  
-  dream :gibbler, '754f87ca720ec256633a286d9270d68478850b2abd7b0ae65021cb769ae70c08' 
26  
-  drill "A Symbol can gibbler", :anything
27  
-  
28  
-  dream :gibbler, 'd345c0afb4e8da0133a3946d3bd9b2622b0acdd8d6cc1237470cc637a9e4777f' 
29  
-  drill "Class can gibbler", Class
30  
-  
31  
-  dream :gibbler, 'b7b874a9bff7825caa57750a900652354ac601b77497b694d313f658c69d25b4' 
32  
-  drill "TrueClass can gibbler", TrueClass
33  
-  
34  
-  dream :gibbler, '88d2bcbd68ce593fd2e0e06f276f7301357516291b95c0c53038e61a9bf091e5' 
35  
-  drill "Empty Hash instance", {}
36  
-  
37  
-end
38  
-
39  
-
40  
-
103  tryouts/14_extended_tryouts.rb
... ...
@@ -1,103 +0,0 @@
1  
-
2  
-library :gibbler, 'lib'
3  
-group "Gibbler Gazette"
4  
-
5  
-Gibbler.enable_debug if Tryouts.verbose > 3
6  
-Gibbler.digest_type = Digest::SHA1
7  
-
8  
-tryouts "Extended object tryouts" do
9  
-
10  
-  dream :gibbler, 'f2b0150c84c5c834406ec9cdec989a0fa938b4ad' 
11  
-  drill "true can gibbler", true
12  
-  
13  
-  dream :gibbler, 'abee839edf5f9c101c505c28987ca35c31c7fc8d' 
14  
-  drill "false can gibbler", false
15  
-  
16  
-  dream :gibbler, '583fb214ec50d2c4a123cc52de0c65e801d13516' 
17  
-  drill "TrueClass can gibbler", TrueClass
18  
-  
19  
-  dream :gibbler, '11f262be475ddf38a25888e9f6ec82f384a7c58b' 
20  
-  drill "FalseClass can gibbler", FalseClass
21  
-  
22  
-  dream :gibbler, '25ac269ae3ef18cdb4143ad02ca315afb5026de9' 
23  
-  drill "Class can gibbler", Class
24  
-  
25  
-  dream :gibbler, '5620e4a8b10ec6830fece61d33f5d3e9a349b4c2' 
26  
-  drill "Object can gibbler", Object
27  
-  
28  
-  dream :gibbler, '083feec632e6cd5347e3fb3c7048365c3a0d710e' 
29  
-  drill "Class instance can gibbler", Class.new
30  
-  
31  
-  dream :gibbler, '7295241e929ffd7cc974cf8d4481291e070937fc' 
32  
-  drill "Module can gibbler", Module
33  
-  
34  
-  dream :gibbler, '6b5a192fd377dfc5c2828a3ad6105b68b6db33d5' 
35  
-  drill "Module instance can gibbler", Module.new
36  
-  
37  
-  dream :gibbler, '8640f7abcbcb80e3825ed827bf36819e26119e16' 
38  
-  drill "Proc can gibbler", Proc
39  
-  
40  
-  dream :gibbler, '5450635218fd16e594976e87abd0955529e28248' 
41  
-  drill "Range instance (..) can gibbler", 1..100
42  
-  
43  
-  dream :gibbler, 'f0cad8cc7582886822e1abb6525a3986d542b810' 
44  
-  drill "Range instance (...) can gibbler", 1...100
45  
-  
46  
-  dream :gibbler, '9d3cd5a21c17cfa0b4bb685730bd07994c486ba2' 
47  
-  drill "Range instance with Floats can gibbler", 0.1...1.5
48  
-
49  
-  dream :gibbler, 'c725659ca0f3fa3c9ab807bb2db4b718e2dca042' 
50  
-  drill "Range instance with one Float can gibbler", 0.1..1
51  
-  
52  
-  drill "Range (..) doesn't equal range (...)", true do
53  
-     ('a'..'e').gibbler != ('a'...'e').gibbler
54  
-  end
55  
-  
56  
-  dream '06fdf26b2a64e90cd35ea9162d9cc48c9f6bb13c'
57  
-  drill "nil has a gibbler", nil.gibbler
58  
-  
59  
-  
60  
-  dream :gibbler, '7295241e929ffd7cc974cf8d4481291e070937fc' 
61  
-  drill "Module can gibbler", Module
62  
-
63  
-  dream :gibbler, '6b5a192fd377dfc5c2828a3ad6105b68b6db33d5' 
64  
-  drill "Module instance can gibbler", Module.new
65  
-
66  
-  dream :gibbler, '25ac269ae3ef18cdb4143ad02ca315afb5026de9' 
67  
-  drill "Class can gibbler", Class
68  
-
69  
-end
70  
-
71  
-
72  
-tryouts "Proc" do
73  
-  
74  
-  setup do
75  
-    class ::MyProc < Proc; end
76  
-  end
77  
-  
78  
-  dream :gibbler, '12075835e94be34438376cd7a54c8db7e746f15d' 
79  
-  drill "Proc.new can gibbler", Proc.new() { }
80  
-  
81  
-  dream :gibbler, '8640f7abcbcb80e3825ed827bf36819e26119e16' 
82  
-  drill "Proc can gibbler", Proc
83  
-    
84  
-  dream :gibbler, '12075835e94be34438376cd7a54c8db7e746f15d' 
85  
-  drill "proc can gibbler", proc {}
86  
-
87  
-  dream :gibbler, '12075835e94be34438376cd7a54c8db7e746f15d' 
88  
-  drill "lambda can gibbler", lambda {}
89  
-  
90  
-  dream :gibbler, '12075835e94be34438376cd7a54c8db7e746f15d' 
91  
-  drill "lambda gibbler is not aware of arity", lambda { |v| }
92  
-  
93  
-  dream :gibbler, '12075835e94be34438376cd7a54c8db7e746f15d' 
94  
-  drill "proc gibbler is not aware of arity", proc { |v| }
95  
-  
96  
-  dream :gibbler, '12075835e94be34438376cd7a54c8db7e746f15d' 
97  
-  drill "Proc gibbler is not aware of proc payload", proc { |v| 1; }
98  
-  
99  
-  dream :gibbler, "c979a45653acaddcb9c1581a7de49c94ac96e128"
100  
-  drill "MyProc has a different digest" do
101  
-    MyProc.new() { }
102  
-  end
103  
-end

0 notes on commit f5c2bc0

Please sign in to comment.
Something went wrong with that request. Please try again.