Post-conditions work, pre-conditions don't

This commit is contained in:
Michael Miller 2019-04-06 12:20:08 -06:00
parent c6c80ccb8e
commit f01fb2df4b
1 changed files with 6 additions and 4 deletions

View File

@ -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