spec/lib/configstruct_spec.rb in configstruct-0.0.4 vs spec/lib/configstruct_spec.rb in configstruct-0.1.0
- old
+ new
@@ -21,11 +21,11 @@
let(:basefile) { File.expand_path('../../files/xxx.yml', __FILE__) }
after { FileUtils.rm basefile if File.exist? basefile }
subject { ConfigStruct.new options }
it 'then a config file is created calling' do
expect(subject.basefile).to eq basefile
- expect(File.exist? basefile).to be_true
+ expect(File.exist? basefile).to be_truthy
end
end
end
describe 'output/input override' do
@@ -45,10 +45,10 @@
it 'redirect printf to StringIO object' do
subject.printf "-- %s --", str
expect(output.string).to eq "-- #{str} --"
end
it 'redirect gets to StringIO object' do
- input.stub(:gets).and_return(str)
+ allow(input).to receive(:gets).and_return(str)
expect(subject.gets).to eq str
end
end
context "when multiple strings are used" do
let(:str2) { "zzz" }