Skip to content

Commit

Permalink
Module.clear_nsurls => Module.reset_nsurls
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Rashkovskii committed May 4, 2008
1 parent caa9bd3 commit bea81c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/strokedb/nsurl.rb
@@ -1,7 +1,9 @@
Module.module_eval do

def self.clear_nsurls
def self.reset_nsurls
@@nsurls = {}
::Module.nsurl ''
::StrokeDB.nsurl StrokeDB::STROKEDB_NSURL
end
def self.find_by_nsurl(url)
@@nsurls[url]
Expand All @@ -19,5 +21,4 @@ def nsurl(url = nil)

end

Module.nsurl ''
StrokeDB.nsurl StrokeDB::STROKEDB_NSURL
Module.reset_nsurls
19 changes: 16 additions & 3 deletions spec/lib/strokedb/nsurl_spec.rb
Expand Up @@ -4,7 +4,11 @@

before(:each) do
@module = Module.new
Module.clear_nsurls
Module.reset_nsurls
end

after(:each) do
Module.reset_nsurls
end

it "should have nil nsurl by default" do
Expand Down Expand Up @@ -38,9 +42,14 @@


before(:each) do
Module.clear_nsurls
Module.reset_nsurls
end

after(:each) do
Module.reset_nsurls
end


it "should have empty nsurl by default" do
Module.nsurl.should be_empty
end
Expand All @@ -50,7 +59,11 @@
describe StrokeDB do

before(:each) do
Module.clear_nsurls
Module.reset_nsurls
end

after(:each) do
Module.reset_nsurls
end

it "should have #{STROKEDB_NSURL} nsurl by default" do
Expand Down

0 comments on commit bea81c9

Please sign in to comment.