Sha256: 5eb74a0ea119bb91268f2a2a46b02939419b82db2c84f91f2346ff97b310239f
Contents?: true
Size: 1.39 KB
Versions: 8
Compression:
Stored size: 1.39 KB
Contents
require "spec_helper" module RSpec::Core describe Hooks do describe "#around" do context "when not running the example within the arond block" do it "does not run the example" do examples = [] group = ExampleGroup.describe do around do |example| end it "foo" do examples << self end end group.run_all examples.should have(0).example end end context "when running the example within the around block" do it "runs the example" do examples = [] group = ExampleGroup.describe do around do |example| example.run end it "foo" do examples << self end end group.run_all examples.should have(1).example end end context "when running the example within a block passed to a method" do it "runs the example" do examples = [] group = ExampleGroup.describe do def yielder yield end around do |example| yielder { example.run } end it "foo" do examples << self end end group.run_all examples.should have(1).example end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems