summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/count_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/count_spec.rb')
-rw-r--r--spec/ruby/core/string/count_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/string/count_spec.rb b/spec/ruby/core/string/count_spec.rb
index e82a7c77ca..e614e901dd 100644
--- a/spec/ruby/core/string/count_spec.rb
+++ b/spec/ruby/core/string/count_spec.rb
@@ -1,4 +1,4 @@
-# -*- encoding: binary -*-
+# encoding: binary
require_relative '../../spec_helper'
require_relative 'fixtures/classes'
@@ -23,7 +23,7 @@ describe "String#count" do
end
it "raises an ArgumentError when given no arguments" do
- lambda { "hell yeah".count }.should raise_error(ArgumentError)
+ -> { "hell yeah".count }.should raise_error(ArgumentError)
end
it "negates sets starting with ^" do
@@ -76,8 +76,8 @@ describe "String#count" do
it "raises if the given sequences are invalid" do
s = "hel-[()]-lo012^"
- lambda { s.count("h-e") }.should raise_error(ArgumentError)
- lambda { s.count("^h-e") }.should raise_error(ArgumentError)
+ -> { s.count("h-e") }.should raise_error(ArgumentError)
+ -> { s.count("^h-e") }.should raise_error(ArgumentError)
end
it 'returns the number of occurrences of a multi-byte character' do
@@ -98,8 +98,8 @@ describe "String#count" do
end
it "raises a TypeError when a set arg can't be converted to a string" do
- lambda { "hello world".count(100) }.should raise_error(TypeError)
- lambda { "hello world".count([]) }.should raise_error(TypeError)
- lambda { "hello world".count(mock('x')) }.should raise_error(TypeError)
+ -> { "hello world".count(100) }.should raise_error(TypeError)
+ -> { "hello world".count([]) }.should raise_error(TypeError)
+ -> { "hello world".count(mock('x')) }.should raise_error(TypeError)
end
end