diff options
author | Tim Emiola <temiola@google.com> | 2015-05-07 13:44:47 -0700 |
---|---|---|
committer | Tim Emiola <temiola@google.com> | 2015-05-07 13:44:47 -0700 |
commit | 13363e31a749fbe5065d66383a0acecbe5ab02fe (patch) | |
tree | e53805d578ffd1de773e52ea7fc108c5f79b77c0 /src/ruby/spec | |
parent | 999971dbf78d182731c5fb0459260a3296069ded (diff) |
make underscore a class method of GenericService
Diffstat (limited to 'src/ruby/spec')
-rw-r--r-- | src/ruby/spec/generic/service_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ruby/spec/generic/service_spec.rb b/src/ruby/spec/generic/service_spec.rb index e7f5a65d3b..6cfc34db84 100644 --- a/src/ruby/spec/generic/service_spec.rb +++ b/src/ruby/spec/generic/service_spec.rb @@ -56,15 +56,6 @@ end GenericService = GRPC::GenericService Dsl = GenericService::Dsl -describe 'String#underscore' do - it 'should convert CamelCase to underscore separated' do - expect('AnRPC'.underscore).to eq('an_rpc') - expect('AMethod'.underscore).to eq('a_method') - expect('PrintHTML'.underscore).to eq('print_html') - expect('PrintHTMLBooks'.underscore).to eq('print_html_books') - end -end - describe Dsl do it 'can be included in new classes' do blk = proc { Class.new { include Dsl } } @@ -73,6 +64,15 @@ describe Dsl do end describe GenericService do + context '#underscore' do + it 'should convert CamelCase to underscore separated' do + expect(GenericService.underscore('AnRPC')).to eq('an_rpc') + expect(GenericService.underscore('AMethod')).to eq('a_method') + expect(GenericService.underscore('PrintHTML')).to eq('print_html') + expect(GenericService.underscore('SeeHTMLBooks')).to eq('see_html_books') + end + end + describe 'including it' do it 'adds a class method, rpc' do c = Class.new do |