aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/kernel/warn_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/kernel/warn_spec.rb')
-rw-r--r--spec/ruby/core/kernel/warn_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/core/kernel/warn_spec.rb b/spec/ruby/core/kernel/warn_spec.rb
index 7e0a57fa9a..d05a37958d 100644
--- a/spec/ruby/core/kernel/warn_spec.rb
+++ b/spec/ruby/core/kernel/warn_spec.rb
@@ -21,56 +21,56 @@ describe "Kernel#warn" do
end
it "does not append line-end if last character is line-end" do
- lambda {
+ -> {
$VERBOSE = true
warn("this is some simple text with line-end\n")
}.should output(nil, "this is some simple text with line-end\n")
end
it "calls #write on $stderr if $VERBOSE is true" do
- lambda {
+ -> {
$VERBOSE = true
warn("this is some simple text")
}.should output(nil, "this is some simple text\n")
end
it "calls #write on $stderr if $VERBOSE is false" do
- lambda {
+ -> {
$VERBOSE = false
warn("this is some simple text")
}.should output(nil, "this is some simple text\n")
end
it "does not call #write on $stderr if $VERBOSE is nil" do
- lambda {
+ -> {
$VERBOSE = nil
warn("this is some simple text")
}.should output(nil, "")
end
it "writes each argument on a line when passed multiple arguments" do
- lambda {
+ -> {
$VERBOSE = true
warn("line 1", "line 2")
}.should output(nil, "line 1\nline 2\n")
end
it "writes each array element on a line when passes an array" do
- lambda {
+ -> {
$VERBOSE = true
warn(["line 1", "line 2"])
}.should output(nil, "line 1\nline 2\n")
end
it "does not write strings when passed no arguments" do
- lambda {
+ -> {
$VERBOSE = true
warn
}.should output("", "")
end
it "writes the default record separator and NOT $/ to $stderr after the warning message" do
- lambda {
+ -> {
$VERBOSE = true
$/ = 'rs'
warn("")
@@ -80,7 +80,7 @@ describe "Kernel#warn" do
it "writes to_s representation if passed a non-string" do
obj = mock("obj")
obj.should_receive(:to_s).and_return("to_s called")
- lambda {
+ -> {
$VERBOSE = true
warn(obj)
}.should output(nil, "to_s called\n")