2
내 환경 :RSpec은 먼저 컨텍스트를 읽은 다음 before (: all)를 읽습니다. 왜?
jruby-1.5.3
Rails 2.3.8
RSpec 1.3.1
Windows 7 (64-bit machine)
다음과 같은 소스 코드를 RSpec에 실행은, 왜 '=>'문 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