任意の RSpec テストを実行する前にコードを実行したいのですが、テスト対象のサンプル グループが特定のディレクトリにあるか、特定のタグを持っている場合に限られます。
たとえば、次のグループがあるとします。
## spec/file_one.rb
describe "Spec One - A group which needs the external app running", :external => true do
describe "Spec Two - A group which does not need the external app running" do
## spec/file_two.rb
describe "Spec Three - A group which does NOT need the external app running" do
## spec/always_run/file_three.rb
describe "Spec Four - A group which does need the external app running"
次に、テスト実行にスペック 1 またはスペック 4 が含まれている場合にのみコードを実行するようにします。
これは、ファイル名に依存できる場合は比較的簡単に実行できますが、タグに依存する場合は困難です。どのファイルの例が実行されるかを確認してから、それらのタグを確認するにはどうすればよいですか?