lstrip_spec.rb 965 B

1234567891011121314151617181920212223242526272829303132
  1. require 'spec_helper_acceptance'
  2. describe 'lstrip function' do
  3. describe 'success' do
  4. pp1 = <<-DOC
  5. $a = [" the "," public "," art","galleries "]
  6. # Anagram: Large picture halls, I bet
  7. $o = lstrip($a)
  8. notice(inline_template('lstrip is <%= @o.inspect %>'))
  9. DOC
  10. it 'lstrips arrays' do
  11. apply_manifest(pp1, :catch_failures => true) do |r|
  12. expect(r.stdout).to match(%r{lstrip is \["the ", "public ", "art", "galleries "\]})
  13. end
  14. end
  15. pp2 = <<-DOC
  16. $a = " blowzy night-frumps vex'd jack q "
  17. $o = lstrip($a)
  18. notice(inline_template('lstrip is <%= @o.inspect %>'))
  19. DOC
  20. it 'lstrips strings' do
  21. apply_manifest(pp2, :catch_failures => true) do |r|
  22. expect(r.stdout).to match(%r{lstrip is "blowzy night-frumps vex'd jack q "})
  23. end
  24. end
  25. end
  26. describe 'failure' do
  27. it 'handles no arguments'
  28. it 'handles non strings or arrays'
  29. end
  30. end