Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move tests to spec so spec_helper is required properly. Also use a ge…

…mfile to require gems.
  • Loading branch information...
commit f734135c455c7ce18ec55e1a3a23f36a6c2745df 1 parent 18102c9
@jamesu authored
View
15 Gemfile
@@ -0,0 +1,15 @@
+source :rubygems
+gem 'sinatra', :require => false
+gem 'sqlite3'
+gem 'activesupport'
+gem 'activerecord'
+gem 'json'
+gem 'nokogiri'
+
+gem 'foreman', :require => false
+
+group :test do
+ gem 'rspec'
+ gem 'rack-test'
+ gem 'timecop'
+end
View
5 core.rb
@@ -1,5 +1,8 @@
require 'rubygems'
-require 'nokogiri'
+require 'bundler'
+Bundler.setup
+Bundler.require(:default, (ENV["RACK_ENV"]||'development').to_sym)
+
require 'fileutils'
require 'date'
require 'time'
View
2  tests/bip_spec.rb → spec/bip_spec.rb
@@ -7,7 +7,7 @@
end
it "should parse messages" do
- bip_data = File.open("tests/fixtures/bip.log") {|f| f.read}
+ bip_data = File.open("spec/fixtures/bip.log") {|f| f.read}
@data = StringIO.new(bip_data)
@data.each_line do |line|
event = @parser.parse_line(line)
View
2  tests/colloquy_spec.rb → spec/colloquy_spec.rb
@@ -7,7 +7,7 @@
end
it "should parse messages" do
- colloquy_data = File.open("tests/fixtures/sample.colloquyTranscript") {|f| f.read}
+ colloquy_data = File.open("spec/fixtures/sample.colloquyTranscript") {|f| f.read}
xmlDoc = Nokogiri::XML.parse(colloquy_data)
xmlDoc.xpath('log/*').each do |node|
View
0  tests/fixtures/bip.log → spec/fixtures/bip.log
File renamed without changes
View
0  tests/fixtures/ircii.log → spec/fixtures/ircii.log
File renamed without changes
View
0  tests/fixtures/sample.colloquyTranscript → spec/fixtures/sample.colloquyTranscript
File renamed without changes
View
0  tests/fixtures/sample.json → spec/fixtures/sample.json
File renamed without changes
View
0  tests/fixtures/talker.html → spec/fixtures/talker.html
File renamed without changes
View
2  tests/ircii_spec.rb → spec/ircii_spec.rb
@@ -9,7 +9,7 @@
end
it "should parse messages" do
- ircii_data = File.open("tests/fixtures/ircii.log") {|f| f.read}
+ ircii_data = File.open("spec/fixtures/ircii.log") {|f| f.read}
@data = StringIO.new(ircii_data)
events = []
@data.each_line do |line|
View
2  tests/json_spec.rb → spec/json_spec.rb
@@ -7,7 +7,7 @@
end
it "should parse messages" do
- json_data = File.open("tests/fixtures/sample.json") {|f| f.read}
+ json_data = File.open("spec/fixtures/sample.json") {|f| f.read}
@parser.parse(StringIO.new(json_data))
@collection.entries.length.should == 11
View
4 tests/parser_spec.rb → spec/parser_spec.rb
@@ -4,7 +4,7 @@
it "should parse xml-based messages" do
collection = LogCollection.new
parser = ColloquyParser.new(collection)
- colloquy_data = File.open("tests/fixtures/sample.colloquyTranscript") {|f| f.read}
+ colloquy_data = File.open("spec/fixtures/sample.colloquyTranscript") {|f| f.read}
parser.parse(StringIO.new(colloquy_data))
collection.senders.keys.length.should == 2
@@ -17,7 +17,7 @@
it "should parse line-based messages" do
collection = LogCollection.new
parser = IrciiParser.new(collection)
- ircii_data = File.open("tests/fixtures/ircii.log") {|f| f.read}
+ ircii_data = File.open("spec/fixtures/ircii.log") {|f| f.read}
parser.parse(StringIO.new(ircii_data))
collection.senders.keys.length.should == 9
View
2  spec/spec_helper.rb
@@ -0,0 +1,2 @@
+require "#{File.dirname(__FILE__)}/../core"
+require 'rspec'
View
2  tests/talker_spec.rb → spec/talker_spec.rb
@@ -7,7 +7,7 @@
end
it "should parse messages" do
- talker_data = File.open("tests/fixtures/talker.html") {|f| f.read}
+ talker_data = File.open("spec/fixtures/talker.html") {|f| f.read}
xmlDoc = Nokogiri::HTML.parse(talker_data)
xmlDoc.xpath('//script').each do |log_node|
event = @parser.parse_node(log_node)
View
2  spec_helper.rb
@@ -1,2 +0,0 @@
-require 'core'
-
Please sign in to comment.
Something went wrong with that request. Please try again.