spec/pratt_spec.rb in Pratt-1.6.2 vs spec/pratt_spec.rb in Pratt-1.6.4
- old
+ new
@@ -53,12 +53,12 @@
end
end
describe "\b#root" do
before :each do
- Dir.stubs(:pwd).returns("/home/scott/git/pratt")
- @expected_root = "/home/scott/git/pratt"
+ @expected_root = File.dirname( File.expand_path( '..', __FILE__ ) ).to_s
+ Dir.stubs(:pwd).returns(@expected_root)
end
it "is correct without arguments" do
Pratt.root.should == [Pathname.new(@expected_root)]
end
@@ -73,12 +73,13 @@
Pratt.root('models').should == [Pathname.new(File.join(@expected_root, "models"))]
end
it "is correct with an argument and block" do
received = []
+ expected = %w(app.rb customer.rb project.rb payment.rb pratt.rb whence.rb invoice.rb invoice_whence.rb zip.rb)
Pratt.root('models', '*.rb') {|model| received << model }
- received.to_set.should == %w(app.rb customer.rb project.rb payment.rb pratt.rb whence.rb).collect {|model| Pathname.new File.join(@expected_root, "models", model) }.to_set
+ received.to_set.should == expected.collect {|model| Pathname.new File.join(@expected_root, "models", model) }.to_set
end
end
describe "graph" do
before :each do
@@ -123,10 +124,10 @@
@pratt.graph.should == "No data to report"
end
it "should look right with data" do
populate_with_data
-# @pratt.expects(:process_template!)
+ @pratt.expects(:process_template!)
@pratt.graph.should == get_expected_display
end
end