Guest User

Untitled

a guest
Apr 19th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. ## string
  2.  
  3. Story: String manipulation
  4.  
  5. As a developer
  6. I want to manipulate strings
  7. ...
  8. Profit!
  9.  
  10. Scenario: String reversal
  11.  
  12. Given the string Linux
  13. When the string is reversed
  14. Then the result should be xuniL
  15.  
  16. ## story_spec.rb
  17.  
  18. require 'rubygems'
  19. require 'spec/story'
  20.  
  21. steps_for(:string_manipulation) do
  22. Given("the string $string") do |string|
  23. @string = string
  24. end
  25.  
  26. When("the string is reversed") do
  27. @string.reverse!
  28. end
  29.  
  30. Then("the result should be $result") do |result|
  31. @string.should == result
  32. end
  33. end
  34.  
  35. with_steps_for(:string_manipulation) do
  36. run "string"
  37. end
Add Comment
Please, Sign In to add comment