Skip to content

Instantly share code, notes, and snippets.

@sgonyea
Created March 2, 2011 07:57
Show Gist options
  • Save sgonyea/850629 to your computer and use it in GitHub Desktop.
Save sgonyea/850629 to your computer and use it in GitHub Desktop.
github.com/sgonyea/string_stubber
sgonyea@skg:~/Sites/string_stubber$ rvm exec "ruby -v && rake spec"
rubinius 1.2.3dev (1.8.7 2c952b20 yyyy-mm-dd JI) [x86_64-apple-darwin10.6.0]
(in /Users/sgonyea/Sites/string_stubber)
/Users/sgonyea/.rvm/rubies/rbx-head/bin/rbx -S bundle exec rspec --color spec/quality_spec.rb spec/string_stubber/base_spec.rb spec/string_stubber/core_ext_spec.rb spec/string_stubber/readme_spec.rb
The application itself
has no malformed whitespace
Stubber::Base
The Base module should behave like a proper mix-in ;)
should have class methods available
The stubbing methods should behave as documented
Methods: stub_words, scan_words
should return the expected number of words
should always return a string
should never have trailing spaces
Should only have trailing non-words if they immediately follow words
Methods: stub_text, scan_text
should return fewer chars than specified, if the offset is in the middle of a word
should return the same number of chars specified, if the offset lands on a punctuation character
should return fewer chars than specified, if the position lands in white-space
should return the whole string, if the ammt of text exceeds the amount of actual text
should return a copy of the whole string, if the ammt of text exceeds the amount of actual text
should always return a string
Methods: scan_word
should scan ahead exactly one word
should return the correct word
scan_word should return a string, unless there is no more to scan
Stubber::CoreExt
The CoreExt module should be mixed into String (via stubber.rb)
should have class methods available
The stubbing methods should behave as documented
should return a StringScanner instance, when calling String#scanner
should act upon the String instance, itself
Method: stub_words
should retain its position
should always return a string
should correctly act on negative offsets (FAILED - 1)
should never have trailing spaces (PENDING: Not Yet Implemented)
should return the expected number of words (PENDING: Not Yet Implemented)
Method: stub_at_most
should retain its position, relative to what was returned
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
Method: stub_at_least
should retain its position
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
Stubber::Readme
shouldn't make me look bad (FAILED - 2)
Pending:
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:52
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should return the expected number of words
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:53
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_at_most should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:75
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_at_least should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:106
Failures:
1) Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should correctly act on negative offsets
Failure/Error: @text.stub_words( -1).should eql("placerat. ")
expected "placerat. "
got "meroL"
(compared using eql?)
# ./spec/string_stubber/core_ext_spec.rb:47:in `__script__'
# kernel/common/eval.rb:164:in `instance_eval'
# kernel/common/throw_catch.rb:34:in `catch'
# kernel/common/throw_catch.rb:13:in `register'
# kernel/common/throw_catch.rb:33:in `catch'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:71:in `each'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:71:in `each'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:71:in `each'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:71:in `each'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/loader.rb:614:in `epilogue'
# kernel/loader.rb:705:in `main'
# kernel/loader.rb:715:in `main'
# kernel/loader.rb:726:in `__script__'
2) Stubber::Readme shouldn't make me look bad
Failure/Error: str.stub_words(-5).should == "risus vitae lorem iaculis placerat."
expected: "risus vitae lorem iaculis placerat."
got: "tema tis rolod muspi meroL" (using ==)
# ./spec/string_stubber/readme_spec.rb:20:in `__script__'
# kernel/common/eval.rb:164:in `instance_eval'
# kernel/common/throw_catch.rb:34:in `catch'
# kernel/common/throw_catch.rb:13:in `register'
# kernel/common/throw_catch.rb:33:in `catch'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:71:in `each'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/bootstrap/array.rb:71:in `each'
# kernel/bootstrap/array.rb:90:in `map'
# kernel/loader.rb:614:in `epilogue'
# kernel/loader.rb:705:in `main'
# kernel/loader.rb:715:in `main'
# kernel/loader.rb:726:in `__script__'
Finished in 1.47 seconds
32 examples, 2 failures, 4 pending
rake aborted!
ruby -S bundle exec rspec --color spec/quality_spec.rb spec/string_stubber/base_spec.rb spec/string_stubber/core_ext_spec.rb spec/string_stubber/readme_spec.rb failed
(See full trace by running task with --trace)
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.6.0]
(in /Users/sgonyea/Sites/string_stubber)
/Users/sgonyea/.rvm/rubies/ruby-1.8.7-p334/bin/ruby -S bundle exec rspec --color spec/quality_spec.rb spec/string_stubber/base_spec.rb spec/string_stubber/core_ext_spec.rb spec/string_stubber/readme_spec.rb
The application itself
has no malformed whitespace
Stubber::Base
The Base module should behave like a proper mix-in ;)
should have class methods available
The stubbing methods should behave as documented
Methods: stub_words, scan_words
should return the expected number of words
should always return a string
should never have trailing spaces
Should only have trailing non-words if they immediately follow words
Methods: stub_text, scan_text
should return fewer chars than specified, if the offset is in the middle of a word
should return the same number of chars specified, if the offset lands on a punctuation character
should return fewer chars than specified, if the position lands in white-space
should return the whole string, if the ammt of text exceeds the amount of actual text
should return a copy of the whole string, if the ammt of text exceeds the amount of actual text
should always return a string
Methods: scan_word
should scan ahead exactly one word
should return the correct word
scan_word should return a string, unless there is no more to scan
Stubber::CoreExt
The CoreExt module should be mixed into String (via stubber.rb)
should have class methods available
The stubbing methods should behave as documented
should return a StringScanner instance, when calling String#scanner
should act upon the String instance, itself
Method: stub_words
should retain its position
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
should return the expected number of words (PENDING: Not Yet Implemented)
Method: stub_at_most
should retain its position, relative to what was returned
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
Method: stub_at_least
should retain its position
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
Stubber::Readme
shouldn't make me look bad
Pending:
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:52
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should return the expected number of words
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:53
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_at_most should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:75
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_at_least should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:106
Finished in 0.12271 seconds
32 examples, 0 failures, 4 pending
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
(in /Users/sgonyea/Sites/string_stubber)
/Users/sgonyea/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -S bundle exec rspec --color spec/quality_spec.rb spec/string_stubber/base_spec.rb spec/string_stubber/core_ext_spec.rb spec/string_stubber/readme_spec.rb
The application itself
has no malformed whitespace
Stubber::Base
The Base module should behave like a proper mix-in ;)
should have class methods available
The stubbing methods should behave as documented
Methods: stub_words, scan_words
should return the expected number of words
should always return a string
should never have trailing spaces
Should only have trailing non-words if they immediately follow words
Methods: stub_text, scan_text
should return fewer chars than specified, if the offset is in the middle of a word
should return the same number of chars specified, if the offset lands on a punctuation character
should return fewer chars than specified, if the position lands in white-space
should return the whole string, if the ammt of text exceeds the amount of actual text
should return a copy of the whole string, if the ammt of text exceeds the amount of actual text
should always return a string
Methods: scan_word
should scan ahead exactly one word
should return the correct word
scan_word should return a string, unless there is no more to scan
Stubber::CoreExt
The CoreExt module should be mixed into String (via stubber.rb)
should have class methods available
The stubbing methods should behave as documented
should return a StringScanner instance, when calling String#scanner
should act upon the String instance, itself
Method: stub_words
should retain its position
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
should return the expected number of words (PENDING: Not Yet Implemented)
Method: stub_at_most
should retain its position, relative to what was returned
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
Method: stub_at_least
should retain its position
should always return a string
should correctly act on negative offsets
should never have trailing spaces (PENDING: Not Yet Implemented)
Stubber::Readme
shouldn't make me look bad
Pending:
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:52
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_words should return the expected number of words
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:53
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_at_most should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:75
Stubber::CoreExt The stubbing methods should behave as documented Method: stub_at_least should never have trailing spaces
# Not Yet Implemented
# ./spec/string_stubber/core_ext_spec.rb:106
Finished in 0.07869 seconds
32 examples, 0 failures, 4 pending
sgonyea@skg:~/Sites/string_stubber$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment