Refactoring stack_spec.rb