eetee 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,65 +14,6 @@ module HTTPTest
14
14
  @app.last_response
15
15
  end
16
16
 
17
- def propfind(url, properties = :all, opts = {})
18
- namespaces = {
19
- 'DAV:' => 'D',
20
- 'urn:ietf:params:xml:ns:carddav' => 'C',
21
- 'http://calendarserver.org/ns/' => 'APPLE1'
22
- }
23
-
24
- if properties == :all
25
- body = "<D:allprop />"
26
-
27
- else
28
- properties = properties.map do |(name, ns)|
29
- ns_short = namespaces[ns]
30
- raise "unknown namespace: #{ns}" unless ns_short
31
- %.<#{ns_short}:#{name}/>.
32
- end
33
-
34
- body = "<D:prop>#{properties.join("\n")}</D:prop>"
35
- end
36
-
37
-
38
- data = <<-EOS
39
- <?xml version="1.0" encoding="UTF-8"?>
40
- <D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav" xmlns:APPLE1="http://calendarserver.org/ns/">
41
- #{body}
42
- </D:propfind>
43
- EOS
44
-
45
- request('PROPFIND', url, opts.merge(input: data))
46
- end
47
-
48
- def ensure_element_exists(response, expr, namespaces = {'D' => 'DAV:'})
49
- ret = Nokogiri::XML(response.body)
50
- ret.css(expr, namespaces).tap{|elements| elements.should.not.be.empty? }
51
- rescue EEtee::AssertionFailed => err
52
- raise EEtee::AssertionFailed.new("XML did not match: #{expr}")
53
- end
54
-
55
- def ensure_element_does_not_exists(response, expr, namespaces = {})
56
- ret = Nokogiri::XML(response.body)
57
- ret.css(expr, namespaces).should.be.empty?
58
- rescue EEtee::AssertionFailed => err
59
- raise EEtee::AssertionFailed.new("XML did match: #{expr}")
60
- end
61
-
62
- def element_content(response, expr, namespaces = {})
63
- ret = Nokogiri::XML(response.body)
64
- elements = ret.css(expr, namespaces)
65
- if elements.empty?
66
- :missing
67
- else
68
- children = elements.first.element_children
69
- if children.empty?
70
- :empty
71
- else
72
- children.first.text
73
- end
74
- end
75
- end
76
17
  end
77
18
 
78
19
  EEtee::Context.__send__(:include, HTTPTest)
data/lib/eetee/runner.rb CHANGED
@@ -34,7 +34,7 @@ module EEtee
34
34
  paths.each do |path|
35
35
  if File.exist?(path)
36
36
  data = File.read(path)
37
- if data =~ /^\s+should.*?,\s+:focus => true do$/
37
+ if data =~ /^\s+(should|it).*?,\s+:focus => true do$/
38
38
  puts "Focus enabled."
39
39
  @focus_mode = true
40
40
  else
data/lib/eetee/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EEtee
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,5 @@
1
+
2
+ guard 'eetee' do
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "specs/lib/#{m[1]}_spec.rb" }
4
+ watch(%r{specs/.+\.rb$})
5
+ end
data/lib/guard/eetee.rb CHANGED
@@ -5,6 +5,12 @@ gem 'guard', '~> 1.5.3'
5
5
 
6
6
  module Guard
7
7
  class EEtee < Guard
8
+
9
+ def self.template(*)
10
+ File.read(
11
+ File.expand_path('../Guardfile', __FILE__)
12
+ )
13
+ end
8
14
 
9
15
  # Initialize a Guard.
10
16
  # @param [Array<Guard::Watcher>] watchers the Guard file watchers
data/tests/multi/run.rb CHANGED
@@ -6,5 +6,5 @@ require "eetee"
6
6
  include EEtee
7
7
 
8
8
 
9
- Runner.new.run_files("file*.rb")
9
+ Runner.new.run_pattern("file*.rb")
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eetee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-02 00:00:00.000000000 Z
12
+ date: 2012-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: term-ansicolor
@@ -63,6 +63,7 @@ files:
63
63
  - lib/eetee/shared.rb
64
64
  - lib/eetee/test.rb
65
65
  - lib/eetee/version.rb
66
+ - lib/guard/Guardfile
66
67
  - lib/guard/eetee.rb
67
68
  - specs/spec_helper.rb
68
69
  - specs/unit/assertion_wrapper_spec.rb
@@ -87,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  segments:
89
90
  - 0
90
- hash: -1848565578778888050
91
+ hash: -3545778618917572052
91
92
  required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  none: false
93
94
  requirements:
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  version: '0'
97
98
  segments:
98
99
  - 0
99
- hash: -1848565578778888050
100
+ hash: -3545778618917572052
100
101
  requirements: []
101
102
  rubyforge_project:
102
103
  rubygems_version: 1.8.23