Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'asgard' # Or whatever the file is called
- class TestBackend
- def initialize(*)
- @stack = []
- @closed = false
- end
- def run
- until @closed
- sleep 0.05
- end
- end
- def stack
- @stack.slice!(0..-1)
- end
- def push(line)
- @stack << line
- end
- def close
- @closed = true # Stops the running thread
- end
- end
- describe BackendMaster do
- it "should initialize without error" do
- lambda { BackendMaster.new }.should_not raise_error
- end
- it "should accept a backend with the run_backend method" do
- backend = TestBackend.new
- bm = BackendMaster.new
- bm.run_backend(backend)
- bm.backends.should include(backend)
- end
- end
Add Comment
Please, Sign In to add comment