Dir.chdir changes directory but raises an error if the target folder does not exist. Since 'nonexistent_folder' does not exist, Dir.chdir raises an error.
Final Answer:
Raises an error because folder does not exist -> Option B
Quick Check:
Dir.chdir to missing folder = error [OK]
Quick Trick:Dir.chdir errors if directory missing [OK]
Common Mistakes:
Assuming it creates folder automatically
Expecting silent failure
Thinking it returns false instead of error
Master "File IO" in Ruby
9 interactive learning modes - each teaches the same concept differently