spec/templates/template_spec.rb in ronin-support-0.5.1 vs spec/templates/template_spec.rb in ronin-support-0.5.2
- old
+ new
@@ -9,46 +9,46 @@
let(:relative_template) { File.join(Helpers::TEMPLATE_DIR,'includes','_relative.erb') }
subject { ExampleTemplate.new }
it "should return the result of the block when entering a template" do
- subject.enter_example_template { |path|
+ expect(subject.enter_example_template { |path|
'result'
- }.should == 'result'
+ }).to eq('result')
end
it "should be able to find templates relative to the current one" do
subject.enter_example_template do |path|
- path.should == example_template
+ expect(path).to eq(example_template)
end
end
it "should be able to find static templates" do
subject.enter_relative_template do |path|
- path.should == relative_template
+ expect(path).to eq(relative_template)
end
end
it "should raise a RuntimeError when entering an unknown template" do
- lambda {
+ expect {
subject.enter_missing_template { |path| }
- }.should raise_error(RuntimeError)
+ }.to raise_error(RuntimeError)
end
it "should be able to read templates relative to the current one" do
subject.read_example_template do |contents|
- contents.should == File.read(example_template)
+ expect(contents).to eq(File.read(example_template))
end
end
it "should be able to find static templates" do
subject.read_relative_template do |contents|
- contents.should == File.read(relative_template)
+ expect(contents).to eq(File.read(relative_template))
end
end
it "should raise a RuntimeError when entering an unknown template" do
- lambda {
+ expect {
subject.read_missing_template { |path| }
- }.should raise_error(RuntimeError)
+ }.to raise_error(RuntimeError)
end
end