datasift 3.0.0.beta2 → 3.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require 'rake/testtask'
3
-
4
- desc 'Default: run all tests'
5
- task :default => [:test]
6
-
7
- desc 'Run all DataSift unit tests'
8
- Rake::TestTask.new do |t|
9
- t.libs << 'lib'
10
- t.libs << 'test'
11
- t.pattern = 'test/**/*_test.rb'
12
- end
@@ -1,44 +0,0 @@
1
- dir = File.dirname(__FILE__)
2
-
3
- require dir + '/../examples/auth'
4
- require 'test/unit'
5
- class CoreApiTest < Test::Unit::TestCase
6
-
7
- def setup
8
- auth = DataSiftExample.new
9
- @datasift = auth.datasift
10
- @csdl = 'interaction.content contains "test"'
11
- end
12
-
13
-
14
- def teardown
15
- # Do nothing
16
- end
17
-
18
- def test_csdl_validation
19
- assert_true @datasift.valid?(@csdl)
20
- assert_raise_kind_of BadRequestError do
21
- @datasift.valid?(@csdl+' random string')
22
- end
23
- end
24
-
25
- def test_compile
26
- stream = @datasift.compile(@csdl)
27
- hash_asserts(stream)
28
- end
29
-
30
- def test_dpus
31
- stream = @datasift.compile(@csdl)
32
- hash_asserts(stream)
33
-
34
- dpus = @datasift.dpu stream[:data][:hash]
35
- assert_not_nil dpus[:data][:dpu]
36
- assert_not_nil dpus[:data][:detail]
37
- end
38
-
39
- def hash_asserts(stream)
40
- assert_not_nil stream[:data]
41
- assert_not_nil stream[:data][:hash]
42
- end
43
-
44
- end