Permalink
Browse files

Organized test in an appropriate fashion for the times

  • Loading branch information...
1 parent c4ec3a7 commit 9befce2763c9806732330f95875c6ec1e9207b9d @malomalo malomalo committed Sep 25, 2009
View
@@ -26,5 +26,5 @@ MetricFu::Configuration.run do |config|
end
Rake::TestTask.new(:test) do |t|
- t.test_files = FileList['test/*_test.rb']
+ t.test_files = FileList['test/**/*_test.rb']
end
@@ -1,14 +1,14 @@
-require File.dirname(__FILE__) + '/test_helper'
+require File.dirname(__FILE__) + '/../../test_helper'
class FlightStats::DataFeed::FileTest < Test::Unit::TestCase
def test_should_find_ten_updates
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&useUTC=true&lastAccessed=#{Time.now.utc.strftime("%Y-%m-%dT%H:%M")}",
- :body => File.read("#{File.dirname(__FILE__)}/responses/feed_file_list.xml"))
+ :body => File.read("#{File.dirname(__FILE__)}/../../responses/feed_file_list.xml"))
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&file=4551477",
- :body => File.read("#{File.dirname(__FILE__)}/responses/test1.gz"))
+ :body => File.read("#{File.dirname(__FILE__)}/../../responses/test1.gz"))
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&file=4551480",
- :body => File.read("#{File.dirname(__FILE__)}/responses/test2.gz"))
+ :body => File.read("#{File.dirname(__FILE__)}/../../responses/test2.gz"))
count = 0
FlightStats::DataFeed.new.files do |file|
@@ -20,7 +20,7 @@ def test_should_find_ten_updates
end
def test_should_find_5_updates_when_reading_file
- data_file = File.new("#{File.dirname(__FILE__)}/responses/test1.gz")
+ data_file = File.new("#{File.dirname(__FILE__)}/../../responses/test1.gz")
file = FlightStats::DataFeed::File.new(data_file)
count = 0
file.updates do |update|
@@ -31,11 +31,11 @@ def test_should_find_5_updates_when_reading_file
def test_should_check_correctness_of_data
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&useUTC=true&lastAccessed=#{Time.now.utc.strftime("%Y-%m-%dT%H:%M")}",
- :body => File.read("#{File.dirname(__FILE__)}/responses/feed_file_list.xml"))
+ :body => File.read("#{File.dirname(__FILE__)}/../../responses/feed_file_list.xml"))
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&file=4551477",
- :body => File.read("#{File.dirname(__FILE__)}/responses/test1.gz"))
+ :body => File.read("#{File.dirname(__FILE__)}/../../responses/test1.gz"))
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&file=4551480",
- :body => File.read("#{File.dirname(__FILE__)}/responses/test2.gz"))
+ :body => File.read("#{File.dirname(__FILE__)}/../../responses/test2.gz"))
changes = Array.new
FlightStats::DataFeed.new.files do |file|
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require File.dirname(__FILE__) + '/../test_helper'
class DelayFeedTest < Test::Unit::TestCase
@@ -9,7 +9,7 @@ def test_should_set_last_accessed_time
def test_should_find_two_files
FakeWeb.register_uri(:get, "https://www.pathfinder-xml.com/development/feed?login.guid=test&useUTC=true&lastAccessed=#{Time.now.utc.strftime("%Y-%m-%dT%H:%M")}",
- :body => File.read("#{File.dirname(__FILE__)}/responses/feed_file_list.xml"))
+ :body => File.read("#{File.dirname(__FILE__)}/../responses/feed_file_list.xml"))
files = FlightStats::DataFeed.new.files
assert_equal 2, files.size

0 comments on commit 9befce2

Please sign in to comment.