mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 20:00:49 +08:00
init project
This commit is contained in:
23
lib/gitlab-cli/spec/gitlab/objectified_hash_spec.rb
Normal file
23
lib/gitlab-cli/spec/gitlab/objectified_hash_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Gitlab::ObjectifiedHash do
|
||||
before do
|
||||
@hash = {a: 1, b: 2}
|
||||
@oh = Gitlab::ObjectifiedHash.new @hash
|
||||
end
|
||||
|
||||
it "should objectify hash" do
|
||||
expect(@oh.a).to eq(@hash[:a])
|
||||
expect(@oh.b).to eq(@hash[:b])
|
||||
end
|
||||
|
||||
describe "#to_hash" do
|
||||
it "should return an original hash" do
|
||||
expect(@oh.to_hash).to eq(@hash)
|
||||
end
|
||||
|
||||
it "should have an alias #to_h" do
|
||||
expect(@oh.respond_to?(:to_h)).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user