rspec and memory_profiler

This commit is contained in:
Jaiden Mispy 2014-10-14 01:02:08 -07:00
parent 639e200a83
commit d09d968915
7 changed files with 18 additions and 22 deletions

View file

@ -1,4 +1,4 @@
source 'https://rubygems.org'
# Specify your gem's dependencies in libtcod.gemspec
# Specify your gem's dependencies in twitter_ebooks.gemspec
gemspec

View file

@ -47,7 +47,7 @@ module Ebooks
lines.each do |l|
next if l.start_with?('#') # Remove commented lines
next if l.include?('RT') || l.include?('MT') # Remove soft retweets
if l.include?('@')
mentions << l
else

View file

@ -1,19 +0,0 @@
#!/usr/bin/env ruby
# encoding: utf-8
require 'json'
freqmap = {}
data = File.read("data/ANC-all-count.txt")
data = data.unpack("C*").pack("U*")
data.lines.each do |l|
vals = l.split("\t")
freqmap[vals[0]] = vals[-1].to_i
end
File.open("data/wordfreq.json", 'w') do |f|
f.write(JSON.dump(freqmap))
end

BIN
spec/data/0xabad1dea.model Normal file

Binary file not shown.

8
spec/model_spec.rb Normal file
View file

@ -0,0 +1,8 @@
require 'spec_helper'
require 'objspace'
describe Ebooks::Model do
it "does stuff" do
model = Ebooks::Model.load(path("data/0xabad1dea.model"))
end
end

5
spec/spec_helper.rb Normal file
View file

@ -0,0 +1,5 @@
require 'twitter_ebooks'
def path(relpath)
File.join(File.dirname(__FILE__), relpath)
end

View file

@ -15,7 +15,9 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = Ebooks::VERSION
gem.add_runtime_dependency 'minitest'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'memory_profiler'
gem.add_runtime_dependency 'twitter', '~> 4.5'
gem.add_runtime_dependency 'tweetstream', '= 2.5'