spec/variables_spec.rb in env-0.2.0 vs spec/variables_spec.rb in env-0.3.0
- old
+ new
@@ -7,11 +7,11 @@
let(:home) { '/home/alice' }
let(:term) { 'xterm' }
let(:shell) { '/bin/bash' }
before(:each) do
- subject.stub!(:env_hash).and_return(
+ subject.stub!(:env).and_return(
'PATH' => '/usr/local/bin:/usr/bin:/bin',
'HOME' => home,
'TERM' => term,
'LANG' => 'en_US.UTF8',
'COLUMNS' => '80',
@@ -32,28 +32,28 @@
it "should provide access to the HOME variable" do
subject.home.should == Pathname.new(home)
end
it "should use the USERPROFILE variable if HOME is not set" do
- subject.stub!(:env_hash).and_return('USERPROFILE' => home)
+ subject.stub!(:env).and_return('USERPROFILE' => home)
subject.home.should == Pathname.new(home)
end
it "should use HOMEDRIVE and HOMEPATH if HOME is not set" do
drive = 'C:'
- subject.stub!(:env_hash).and_return(
+ subject.stub!(:env).and_return(
'HOMEDRIVE' => drive,
'HOMEPATH' => home
)
subject.home.should == Pathname.new(drive + home)
end
it "should attempt to expand '~' if none of the HOME variables are set" do
- subject.stub!(:env_hash).and_return({})
+ subject.stub!(:env).and_return({})
subject.home.should be_directory
end
it "should parse the LANG variable" do
@@ -62,11 +62,11 @@
name.should == 'en_US'
encoding.should == 'UTF8'
end
it "should return an empty Array if LANG is not set" do
- subject.stub!(:env_hash).and_return({})
+ subject.stub!(:env).and_return({})
subject.lang.should be_empty
end
it "should parse the COLUMNS variable" do
@@ -88,10 +88,10 @@
it "should determine the current Terminal" do
subject.terminal.should == term
end
it "should check COLORTERM before the TERM variable" do
- subject.stub!(:env_hash).and_return(
+ subject.stub!(:env).and_return(
'COLORTERM' => 'gnome-terminal',
'TERM' => term
)
subject.terminal.should == 'gnome-terminal'