summaryrefslogtreecommitdiff
path: root/spec/ruby/language/execution_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/execution_spec.rb')
-rw-r--r--spec/ruby/language/execution_spec.rb80
1 files changed, 1 insertions, 79 deletions
diff --git a/spec/ruby/language/execution_spec.rb b/spec/ruby/language/execution_spec.rb
index 51bcde62e8..3e6e7ff48c 100644
--- a/spec/ruby/language/execution_spec.rb
+++ b/spec/ruby/language/execution_spec.rb
@@ -1,49 +1,10 @@
-require_relative '../spec_helper'
+require File.expand_path('../../spec_helper', __FILE__)
describe "``" do
it "returns the output of the executed sub-process" do
ip = 'world'
`echo disc #{ip}`.should == "disc world\n"
end
-
- it "can be redefined and receive a frozen string as argument" do
- called = false
- runner = Object.new
-
- runner.singleton_class.define_method(:`) do |str|
- called = true
-
- str.should == "test command"
- str.frozen?.should == true
- end
-
- runner.instance_exec do
- `test command`
- end
-
- called.should == true
- end
-
- it "the argument isn't frozen if it contains interpolation" do
- called = false
- runner = Object.new
-
- runner.singleton_class.define_method(:`) do |str|
- called = true
-
- str.should == "test command"
- str.frozen?.should == false
- str << "mutated"
- end
-
- 2.times do
- runner.instance_exec do
- `test #{:command}` # rubocop:disable Lint/LiteralInInterpolation
- end
- end
-
- called.should == true
- end
end
describe "%x" do
@@ -51,43 +12,4 @@ describe "%x" do
ip = 'world'
%x(echo disc #{ip}).should == "disc world\n"
end
-
- it "can be redefined and receive a frozen string as argument" do
- called = false
- runner = Object.new
-
- runner.singleton_class.define_method(:`) do |str|
- called = true
-
- str.should == "test command"
- str.frozen?.should == true
- end
-
- runner.instance_exec do
- %x{test command}
- end
-
- called.should == true
- end
-
- it "the argument isn't frozen if it contains interpolation" do
- called = false
- runner = Object.new
-
- runner.singleton_class.define_method(:`) do |str|
- called = true
-
- str.should == "test command"
- str.frozen?.should == false
- str << "mutated"
- end
-
- 2.times do
- runner.instance_exec do
- %x{test #{:command}} # rubocop:disable Lint/LiteralInInterpolation
- end
- end
-
- called.should == true
- end
end