这完全是愚蠢和不重要的,但我只是好奇:使用RSpec,我能以某种方式访问我所在的范围的“深度”吗?那是...
describe SomeClass do
describe "#some_method" do
context "within some context" do
it "is possible, what I'm asking" do
# Actually, I'm not entirely sure what I'd expect this
# value to be... basically, whatever the RSpec designers
# felt made sense.
mysterious_method_to_get_depth.should == 3
end
end
end
end
我实际上是在问,因为我想输出一些有用的信息,但是测试输出仍然具有最大的可读性(即,具有适当的缩进)。