Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More Tryouts progress

  • Loading branch information...
commit 655eaa9d65d5e9108593c6782718ffd5a98294fa 1 parent f5c2bc0
@delano authored
View
4 try/11_basic_sha256_try.rb
@@ -7,8 +7,7 @@
else
Gibbler.digest_type = Digest::SHA256
end
-
-
+
## A Symbol can gibbler
:anything.gibbler
#=> '754f87ca720ec256633a286d9270d68478850b2abd7b0ae65021cb769ae70c08'
@@ -25,5 +24,6 @@
{}.gibbler
#=> '88d2bcbd68ce593fd2e0e06f276f7301357516291b95c0c53038e61a9bf091e5'
+
Gibbler.digest_type = Digest::SHA1
View
2  try/14_extended_try.rb
@@ -1,7 +1,5 @@
require 'gibbler'
-Gibbler.digest_type = Digest::SHA1
-
## true can gibbler
true.gibbler
#=> 'f2b0150c84c5c834406ec9cdec989a0fa938b4ad'
View
81 try/15_file_try.rb
@@ -1,47 +1,42 @@
require 'tempfile'
+require 'gibbler'
-library :gibbler, 'lib'
-group "Gibbler Gazette"
+@tempfile = "tryouts-9000-awesome.txt"
+
+# File can gibbler
+file = File.new(File.join('.', 'CHANGES.txt'))
+file.gibbler
+#=> 'c052e87bd0acb7e08c98dad7f8b09b4382a08ef6'
-Gibbler.enable_debug if Tryouts.verbose > 3
-Gibbler.digest_type = Digest::SHA1
+
+## Gibbler is different for each path
+file1 = File.new(File.join('.', 'CHANGES.txt'))
+file2 = File.new(File.join('.', 'README.rdoc'))
+file1.gibbler == file2.gibbler
+#=> false
-tryouts "File object tryouts" do
- set :tempfile, "tryouts-9000-awesome.txt"
-
- clean do
- File.unlink tempfile if File.exists? tempfile
- end
-
- dream :gibbler, 'c052e87bd0acb7e08c98dad7f8b09b4382a08ef6'
- drill "File can gibbler" do
- path = File.join('.', 'CHANGES.txt')
- File.new(path)
- end
-
- dream :gibbler, '802511d30dde19213070bacdbf55df779537c67c'
- drill "Gibbler is different for each path" do
- path = File.join('.', 'README.rdoc')
- File.new(path)
- end
-
- ## JRuby doesn't like to use File.new with directories
- ##dream :gibbler, '92cbcb7de73d7748b28d9e911f461013de34410f'
- ##drill "File gibbler cares about trailing slash (/tmp/)", File.new(__FILE__)
-
- dream :respond_to?, :gibbler
- drill "TempFile can gibbler", Tempfile.new('gibbler')
-
- drill "TempFile digests change", false do
- Tempfile.new('gibbler').gibbler == Tempfile.new('gibbler').gibbler
- end
-
- dream :gibbler, '6d93f752fc23f36bffa5ddf9ee97d04be82efbdb'
- drill "File doesn't care about file contents" do
- f = File.open tempfile, 'w'
- f.puts "World's Finest Number: " << "#{rand}"
- f.close
- stash :file_contents, File.read(tempfile)
- File.new tempfile
- end
-end
+
+# TempFile can gibbler
+Tempfile.new('gibbler').respond_to? :gibbler
+#=> true
+
+
+# TempFile digests change
+Tempfile.new('gibbler').gibbler == Tempfile.new('gibbler').gibbler
+#=> false
+
+
+# File doesn't care about file contents
+f = File.open @tempfile, 'w'
+f.puts "World's Finest Number: " << "#{rand}"
+f.close
+File.new(@tempfile).gibbler
+#=> '6d93f752fc23f36bffa5ddf9ee97d04be82efbdb'
+
+
+## JRuby doesn't like to use File.new with directories
+###=> '92cbcb7de73d7748b28d9e911f461013de34410f'
+### "File gibbler cares about trailing slash (/tmp/)", File.new(__FILE__)
+
+
+File.unlink @tempfile if File.exists? @tempfile
View
69 try/16_uri_try.rb
@@ -1,41 +1,32 @@
require 'uri'
+require 'gibbler'
+
+# "URI::HTTP can gibbler" do
+ uri = URI.parse "http://localhost:3114/spaceship"
+ uri.gibbler
+#=> "9efe60a5db66aecf9b5fb8655b0bab0fcc7bd0c5"
+
+
+# "URI::HTTPS can gibbler" do
+ uri = URI.parse "https://localhost:3114/spaceship"
+ uri.gibbler
+#=> "b75d3c34e60d6feafa796ddbb51e45710f6b106d"
+
+
+# "URI::HTTP is trailing slash sensitive" do
+ uri = URI.parse "http://localhost:3114/spaceship/"
+ uri.gibbler
+#=> "191b0072b95ca0c79ed75e6deb5b28562dd9e5b9"
+
+
+# "URI::Generic can gibbler" do
+ uri = URI.parse "localhost:3114/spaceship"
+ uri.gibbler
+#=> "d378372934326947113489d1f36f4853bef90a65"
+
+
+# "URI::FTP can gibbler" do
+ uri = URI.parse "ftp://localhost:3114/spaceship"
+ uri.gibbler
+#=> "9d0543b31afebac9e8d38c56a0cf12070779f790"
-library :gibbler, 'lib'
-group "Gibbler Gazette"
-
-Gibbler.enable_debug if Tryouts.verbose > 3
-Gibbler.digest_type = Digest::SHA1
-
-tryouts "URI object tryouts" do
-
- dream :gibbler, "9efe60a5db66aecf9b5fb8655b0bab0fcc7bd0c5"
- drill "URI::HTTP can gibbler" do
- uri = URI.parse "http://localhost:3114/spaceship"
- uri
- end
-
- dream :gibbler, "b75d3c34e60d6feafa796ddbb51e45710f6b106d"
- drill "URI::HTTPS can gibbler" do
- uri = URI.parse "https://localhost:3114/spaceship"
- uri
- end
-
- dream :gibbler, "191b0072b95ca0c79ed75e6deb5b28562dd9e5b9"
- drill "URI::HTTP is trailing slash sensitive" do
- uri = URI.parse "http://localhost:3114/spaceship/"
- uri
- end
-
- dream :gibbler, "d378372934326947113489d1f36f4853bef90a65"
- drill "URI::Generic can gibbler" do
- uri = URI.parse "localhost:3114/spaceship"
- uri
- end
-
- dream :gibbler, "9d0543b31afebac9e8d38c56a0cf12070779f790"
- drill "URI::FTP can gibbler" do
- uri = URI.parse "ftp://localhost:3114/spaceship"
- uri
- end
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.