public
Rubygem
Description: Extras for DataMapper, including bridges to DataObjects::Migrations and Merb::DataMapper
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-more.git
Added check to see if test app is running
pjb3 (author)
Mon Jun 09 18:33:00 -0700 2008
dkubb (committer)
Tue Jun 17 17:34:28 -0700 2008
commit  da37c25610764f4f1c06897a8dc9be134cd1f4aa
tree    d205b5fe7b0a022e55cd6fe2cb4d22a9e90fa843
parent  6799306d2292a57c3698e697c9e08259f94e7d98
...
18
19
20
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
24
25
26
27
28
29
30
31
32
33
 
 
34
 
 
 
 
 
35
36
...
18
19
20
 
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
 
 
 
 
 
40
 
41
42
43
44
45
46
47
48
49
50
0
@@ -18,18 +18,32 @@ class Book
0
   property :created_at, DateTime
0
 end
0
 
0
-describe Book do
0
+describe DataMapper::Adapters::RestAdapter do
0
+
0
+ before :all do
0
+ @adapter = DataMapper::Repository.adapters[:default]
0
+ @no_connection = false
0
+ unless @no_connection
0
+ begin
0
+ @adapter.send(:http_post, "/books.xml", "")
0
+ rescue Errno::ECONNREFUSED
0
+ @no_connection = true
0
+ end
0
+ end
0
+ end
0
+
0
   it "should be able to get all the books" do
0
+ pending "No connection" if @no_connection
0
     pending "Not Implemented"
0
     Book.all.should_not be_empty
0
   end
0
-end
0
-
0
-describe "A Book" do
0
- before do
0
- @book = Book.new(:title => "Hello, World!", :author => "Anonymous")
0
- end
0
   it "should be able to create a book" do
0
- @book.save
0
+ pending "No connection" if @no_connection
0
+ new_book.save
0
   end
0
+
0
+ def new_book(options={})
0
+ Book.new(options.merge({:title => "Hello, World!", :author => "Anonymous"}))
0
+ end
0
+
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.