From f01fb2df4b510b3bfed47f3d8e04e95428b45d2c Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 6 Apr 2019 12:20:08 -0600 Subject: [PATCH] Post-conditions work, pre-conditions don't --- test_hooks.cr | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test_hooks.cr b/test_hooks.cr index 2886faa..9c3cb3a 100644 --- a/test_hooks.cr +++ b/test_hooks.cr @@ -3,15 +3,17 @@ require "./src/spectator" Spectator.describe Array do let(array) { %i[a b c] } let(original_array) { array.dup } +# pre_condition { is_expected.to_not be_nil } # 1 + post_condition { expect(array).to match_array(original_array) } # 5 subject { array.map(&.to_s) } describe "#foo" do +# pre_condition { expect(subject.first).to eq("a") } # 2 + post_condition { expect(array.size).to eq(26) } # 4 + it "does a cool thing" do - is_expected.to_not be_nil - expect(subject.first).to eq("a") - expect(array.size).to eq(26) - expect(array).to match_array(original_array) + # 3 end end end