You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/lib/gitlab-cli/spec/gitlab/objectified_hash_spec.rb

24 lines
502 B

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