Sha256: d6db2235ed1fe15c95736a06370aa8228948790bb1efa20a2a378c3250ee9743
Contents?: true
Size: 1.38 KB
Versions: 32
Compression:
Stored size: 1.38 KB
Contents
require "spec_helper" module RSpec::Core describe Hooks do describe "#around" do context "when not running the example within the around 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 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 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 examples.should have(1).example end end end end end
Version data entries
32 entries across 32 versions & 4 rubygems