Skip to content

Instantly share code, notes, and snippets.

@batate
Created March 6, 2015 16:51
Show Gist options
  • Save batate/eae00e49fcee1b2a2a7a to your computer and use it in GitHub Desktop.
Save batate/eae00e49fcee1b2a2a7a to your computer and use it in GitHub Desktop.
one experiment, multiple measurements
test "chat" do
bucket = create_bucket
assert %{__struct__: "Bucket"} = bucket
assert Bucket.empty?(bucket)
Bucket.add(bucket, 1)
assert bucket.contents == [1]
end
# instead
setup context do
assign bucket: create_bucket
end
should "create bucket", context do
assert %{__struct__: "Bucket"} = context.bucket
assert Bucket.empty?(bucket)
end
should "be empty", context do
assert Bucket.empty?(bucket)
end
should "add to bucket", context do
Bucket.add(bucket, 1)
assert bucket.contents == 1
end
should "remove from bucket", context ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment