Sha256: 7f5d7dfde2a4813dfec735d4f33afbabb3b4a3e72f217ff5df33d94687a44b2d

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

# We'll be ignoring this for now...
#
# require_relative '../make_db'
# require 'wlog/domain/attachment'
# require 'wlog/domain/log_entry'
# require 'wlog/domain/issue'
# 
# include Wlog
# 
# describe Attachment do 
# 
#   db_name = './default'
#   
#   class FileMock
#     attr_accessor :filename, :data, :path
#   end
# 
#   def create_mock_file
#     fm = FileMock.new
#     fm.filename = "thefile.txt"
#     fm.data = "This is my text data." 
#     fm.path = "/home/user/"
#   fm end
# 
#   before(:all) do
#     make_testing_db(db_name)
#     @db = DbRegistry.new(db_name) 
#     @issue = Issue.new(@db)
#     @log_entry = LogEntry.new(@db)
# 
#     @issue.description = "This is my issue"
#     @issue.insert
#     @log_entry.issue_id = @issue.id
#     @log_entry.description = "This is my log_entry"
#     @log_entry.insert
#   end
# 
#   after(:all) do
#     FileUtils.rm db_name
#   end
# 
#   # Note: this example uses issue, but this will be valid for whatever other
#   # type we want to associate to this class. 
#   it "should insert given polymorphic type" do
#     file = create_mock_file
#     attach = Attachment.new(@db, Issue.name, @issue.id)
#     attach.filename = file.filename
#     attach.data = file.data
#     attach.insert
#     check = Attachment.find(@db, Issue.name, @issue.id)
#     expect(check).to_not eq(nil)
#   end
# 
#   it "should return nil if something is not found" do
#     expect(Attachment.find(@db, Issue.name, 123123123)).to eq(nil)
#   end
# end 
# 

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wlog-1.1.7 spec/domain/attachment_spec.rb
wlog-1.1.6 spec/domain/attachment_spec.rb
wlog-1.1.5 spec/domain/attachment_spec.rb