aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/base64/encode64_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/base64/encode64_spec.rb')
-rw-r--r--spec/ruby/library/base64/encode64_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/library/base64/encode64_spec.rb b/spec/ruby/library/base64/encode64_spec.rb
new file mode 100644
index 0000000000..08df694e54
--- /dev/null
+++ b/spec/ruby/library/base64/encode64_spec.rb
@@ -0,0 +1,14 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+require 'base64'
+
+describe "Base64#encode64" do
+ it "returns the Base64-encoded version of the given string" do
+ Base64.encode64("Now is the time for all good coders\nto learn Ruby").should ==
+ "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g\nUnVieQ==\n"
+ end
+
+ it "returns the Base64-encoded version of the given string" do
+ Base64.encode64('Send reinforcements').should == "U2VuZCByZWluZm9yY2VtZW50cw==\n"
+ end
+end