mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Move spec/rubyspec to spec/ruby for consistency
* Other ruby implementations use the spec/ruby directory. [Misc #13792] [ruby-core:82287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
75bfc6440d
commit
1d15d5f080
4370 changed files with 0 additions and 0 deletions
27
spec/ruby/library/base64/urlsafe_decode64_spec.rb
Normal file
27
spec/ruby/library/base64/urlsafe_decode64_spec.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require File.expand_path('../../../spec_helper', __FILE__)
|
||||
|
||||
require 'base64'
|
||||
|
||||
describe "Base64#urlsafe_decode64" do
|
||||
it "uses '_' instead of '/'" do
|
||||
decoded = Base64.urlsafe_decode64("V2hlcmUgYW0gST8gV2hvIGFtIEk_IEFtIEk_IEk_")
|
||||
decoded.should == 'Where am I? Who am I? Am I? I?'
|
||||
end
|
||||
|
||||
it "uses '-' instead of '+'" do
|
||||
decoded = Base64.urlsafe_decode64('IkJlaW5nIGRpc2ludGVncmF0ZWQgbWFrZXMgbWUgdmUtcnkgYW4tZ3J5ISIgPGh1ZmYsIGh1ZmY-')
|
||||
decoded.should == '"Being disintegrated makes me ve-ry an-gry!" <huff, huff>'
|
||||
end
|
||||
|
||||
ruby_version_is ""..."2.3" do
|
||||
it "requires padding" do
|
||||
lambda { Base64.urlsafe_decode64("MQ") }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "2.3" do
|
||||
it "does not require padding" do
|
||||
Base64.urlsafe_decode64("MQ").should == "1"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue