2
私の環境:RSpecはまずコンテキストを読み込み、before(:all)を読み込みます。どうして?
次のソースコードでRSpecの実行jruby-1.5.3
Rails 2.3.8
RSpec 1.3.1
Windows 7 (64-bit machine)
、なぜ文のbefore(:each)
前の文脈である「=>」の付いたRSpecの読み取りラインはありません。すべてのヘルプははるかに
def save_env @host_os = Config::CONFIG['host_os'] end def restore_env Config::CONFIG['host_os'] = @host_os end describe Manager::ManagerConfig do before(:each) do save_env end after(:each) do restore_env end context "Within Linus/Solaris environment" do => Config::CONFIG['host_os'] = 'linux' it "should return the correct manager path under linux/solaris" do # bar end it "should return the correct license path under windows env" do # foo end end end