Skip to content

Instantly share code, notes, and snippets.

@dorianmariecom
Last active June 5, 2022 16:12
Show Gist options
  • Save dorianmariecom/e6eef1393b6d684bb3300613efac7da8 to your computer and use it in GitHub Desktop.
Save dorianmariecom/e6eef1393b6d684bb3300613efac7da8 to your computer and use it in GitHub Desktop.
~/s/language> crystal a.rb
FF
Failures:
1) Hash(K, V) equals with symbol
Failure/Error: { :a => 1 }.should eq({ a: 1 })
Expected: {a: 1}
got: {:a => 1}
# a.rb:5
2) Hash(K, V) equals with string
Failure/Error: { "a" => 1 }.should eq({ a: 1 })
Expected: {a: 1}
got: {"a" => 1}
# a.rb:9
Finished in 267 microseconds
2 examples, 2 failures, 0 errors, 0 pending
Failed examples:
crystal spec a.rb:4 # Hash(K, V) equals with symbol
crystal spec a.rb:8 # Hash(K, V) equals with string
require "spec"
describe Hash do
it "equals with symbol" do
{ :a => 1 }.should eq({ a: 1 })
end
it "equals with string" do
{ "a" => 1 }.should eq({ a: 1 })
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment