oojs 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/oojspec_helpers/oojspec-jquery.js.coffee +24 -24
- data/lib/oojs/version.rb +1 -1
- data/oojs.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aed43239e544a7b2280a9c6dd8bb1c920fa19661
|
4
|
+
data.tar.gz: 33a29e7904e6ffa063e4b5d50c2151081cbd7072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eb0cef27fc77fb582e1b03cbe840f0671ab3f2b253193e44edc479ac3607818aa4fbe8b6f597fdfad30d7a4a10ce06999f9a9ba057d01ac390a41b847f5e9e4
|
7
|
+
data.tar.gz: 6c546bc00a9453fd9a2ade17579286103ba1a9bbe0a6b4984aa02de97f78620f1c0d464e78abeb31ca4b88f333a02146ea3a7b177d64e36dea8fcc2d09776e3a
|
@@ -27,134 +27,134 @@ toHtml = ($element)->
|
|
27
27
|
browserTagCaseIndependentHtml = (html)-> $('<div/>').append(html).html()
|
28
28
|
|
29
29
|
addAssertion 'hasClass',
|
30
|
-
assert: (@actual, @className)-> $(actual).hasClass className
|
30
|
+
assert: (@actual, @className)-> $(@actual).hasClass @className
|
31
31
|
assertMessage: 'Expected ${actual} to have class ${className}.'
|
32
32
|
refuteMessage: 'Expected ${actual} not to have class ${className}.'
|
33
33
|
expectation: 'toHaveClass'
|
34
34
|
|
35
35
|
addAssertion 'isVisible',
|
36
|
-
assert: (@actual)-> $(actual).is(':visible')
|
36
|
+
assert: (@actual)-> $(@actual).is(':visible')
|
37
37
|
assertMessage: 'Expected ${actual} to be visible.'
|
38
38
|
refuteMessage: 'Expected ${actual} not to be visible.'
|
39
39
|
expectation: 'toBeVisible'
|
40
40
|
|
41
41
|
addAssertion 'isHidden',
|
42
|
-
assert: (@actual)-> $(actual).is(':hidden')
|
42
|
+
assert: (@actual)-> $(@actual).is(':hidden')
|
43
43
|
assertMessage: 'Expected ${actual} to be hidden.'
|
44
44
|
refuteMessage: 'Expected ${actual} not to be hidden.'
|
45
45
|
expectation: 'toBeHidden'
|
46
46
|
|
47
47
|
addAssertion 'isSelected',
|
48
|
-
assert: (@actual)-> $(actual).is(':selected')
|
48
|
+
assert: (@actual)-> $(@actual).is(':selected')
|
49
49
|
assertMessage: 'Expected ${actual} to be selected.'
|
50
50
|
refuteMessage: 'Expected ${actual} not to be selected.'
|
51
51
|
expectation: 'toBeSelected'
|
52
52
|
|
53
53
|
addAssertion 'isChecked',
|
54
|
-
assert: (@actual)-> $(actual).is(':checked')
|
54
|
+
assert: (@actual)-> $(@actual).is(':checked')
|
55
55
|
assertMessage: 'Expected ${actual} to be checked.'
|
56
56
|
refuteMessage: 'Expected ${actual} not to be checked.'
|
57
57
|
expectation: 'toBeChecked'
|
58
58
|
|
59
59
|
addAssertion 'isEmpty',
|
60
|
-
assert: (@actual)-> $(actual).is(':empty')
|
60
|
+
assert: (@actual)-> $(@actual).is(':empty')
|
61
61
|
assertMessage: 'Expected ${actual} to be empty.'
|
62
62
|
refuteMessage: 'Expected ${actual} not to be empty.'
|
63
63
|
expectation: 'toBeEmpty'
|
64
64
|
|
65
65
|
addAssertion 'exists',
|
66
|
-
assert: (@actual)-> $(actual).length
|
66
|
+
assert: (@actual)-> $(@actual).length
|
67
67
|
assertMessage: 'Expected ${actual} to exist.'
|
68
68
|
refuteMessage: 'Expected ${actual} not to exist.'
|
69
69
|
expectation: 'toExist'
|
70
70
|
|
71
71
|
addAssertion 'hasAttr',
|
72
|
-
assert: (@actual, @attribute, @expected)-> hasProperty actual.attr(attribute), expected
|
72
|
+
assert: (@actual, @attribute, @expected)-> hasProperty @actual.attr(@attribute), @expected
|
73
73
|
assertMessage: 'Expected attribute ${attribute} to be ${expected} for ${actual}.'
|
74
74
|
refuteMessage: 'Expected attribute ${attribute} not to be ${expected} for ${actual}.'
|
75
75
|
expectation: 'toHaveAttr'
|
76
76
|
|
77
77
|
addAssertion 'hasProp',
|
78
|
-
assert: (@actual, @property, @expected)-> hasProperty actual.prop(
|
78
|
+
assert: (@actual, @property, @expected)-> hasProperty @actual.prop(@property), @expected
|
79
79
|
assertMessage: 'Expected property ${property} to be ${expected} for ${actual}.'
|
80
80
|
refuteMessage: 'Expected property ${property} not to be ${expected} for ${actual}.'
|
81
81
|
expectation: 'toHaveProp'
|
82
82
|
|
83
83
|
addAssertion 'hasCss',
|
84
84
|
assert: (@actual, @css)->
|
85
|
-
return false for prop, value of css when @actual.css(prop) isnt value
|
85
|
+
return false for prop, value of @css when @actual.css(prop) isnt value
|
86
86
|
true
|
87
87
|
assertMessage: 'Expected ${actual} to have css ${css}.'
|
88
88
|
refuteMessage: 'Expected ${actual} not to have css ${css}.'
|
89
89
|
expectation: 'toHaveCss'
|
90
90
|
|
91
91
|
addAssertion 'hasId',
|
92
|
-
assert: (@actual, @id)-> hasProperty actual.attr('id') is id
|
92
|
+
assert: (@actual, @id)-> hasProperty @actual.attr('id') is @id
|
93
93
|
assertMessage: 'Expected ${actual} to have id ${id}.'
|
94
94
|
refuteMessage: 'Expected ${actual} not to have id ${id}.'
|
95
95
|
expectation: 'toHaveId'
|
96
96
|
|
97
97
|
addAssertion 'hasHtml',
|
98
|
-
assert: (@actual, @html)-> actual.html() is browserTagCaseIndependentHtml html
|
98
|
+
assert: (@actual, @html)-> @actual.html() is browserTagCaseIndependentHtml @html
|
99
99
|
assertMessage: 'Expected ${actual} to have html ${html}.'
|
100
100
|
refuteMessage: 'Expected ${actual} not to have html ${html}.'
|
101
101
|
expectation: 'toHaveHtml'
|
102
102
|
|
103
103
|
addAssertion 'hasText',
|
104
104
|
assert: (@actual, @text)->
|
105
|
-
trimmedText = $.trim actual.text()
|
106
|
-
return text.test trimmedText if text?.test
|
107
|
-
trimmedText is text
|
105
|
+
trimmedText = $.trim @actual.text()
|
106
|
+
return @text.test trimmedText if @text?.test
|
107
|
+
trimmedText is @text
|
108
108
|
assertMessage: 'Expected ${actual} to have text ${text}.'
|
109
109
|
refuteMessage: 'Expected ${actual} not to have text ${text}.'
|
110
110
|
expectation: 'toHaveText'
|
111
111
|
|
112
112
|
addAssertion 'hasValue',
|
113
|
-
assert: (@actual, @value)-> actual.val() is value
|
113
|
+
assert: (@actual, @value)-> @actual.val() is @value
|
114
114
|
assertMessage: 'Expected ${actual} to have value ${value}.'
|
115
115
|
refuteMessage: 'Expected ${actual} not to have value ${value}.'
|
116
116
|
expectation: 'toHaveValue'
|
117
117
|
|
118
118
|
addAssertion 'hasData',
|
119
|
-
assert: (@actual, @key, @value)-> actual.data(key) is value
|
119
|
+
assert: (@actual, @key, @value)-> @actual.data(@key) is @value
|
120
120
|
assertMessage: 'Expected ${key} data to be ${value} for ${actual}.'
|
121
121
|
refuteMessage: 'Expected ${key} data not to be ${value} for ${actual}.'
|
122
122
|
expectation: 'toHaveData'
|
123
123
|
|
124
124
|
addAssertion 'isSelector', # TODO: override toBe?
|
125
|
-
assert: (@actual, @selector)-> actual.is selector
|
125
|
+
assert: (@actual, @selector)-> @actual.is @selector
|
126
126
|
assertMessage: 'Expected ${actual} to be ${selector}.'
|
127
127
|
refuteMessage: 'Expected ${actual} not to be ${selector}.'
|
128
128
|
expectation: 'toBeSelector'
|
129
129
|
|
130
130
|
addAssertion 'containsSelector', # TODO: override contains?
|
131
|
-
assert: (@actual, @selector)-> actual.find(selector).length
|
131
|
+
assert: (@actual, @selector)-> @actual.find(@selector).length
|
132
132
|
assertMessage: 'Expected ${actual} to contain ${selector}.'
|
133
133
|
refuteMessage: 'Expected ${actual} not to contain ${selector}.'
|
134
134
|
expectation: 'toContainSelector'
|
135
135
|
|
136
136
|
addAssertion 'isDisabled',
|
137
|
-
assert: (@actual)-> actual.is ':disabled'
|
137
|
+
assert: (@actual)-> @actual.is ':disabled'
|
138
138
|
assertMessage: 'Expected ${actual} to be disabled.'
|
139
139
|
refuteMessage: 'Expected ${actual} not to be disabled.'
|
140
140
|
expectation: 'toBeDisabled'
|
141
141
|
|
142
142
|
addAssertion 'isFocused',
|
143
|
-
assert: (@actual)-> actual.is ':focus'
|
143
|
+
assert: (@actual)-> @actual.is ':focus'
|
144
144
|
assertMessage: 'Expected ${actual} to be focused.'
|
145
145
|
refuteMessage: 'Expected ${actual} not to be focused.'
|
146
146
|
expectation: 'toBeFocused'
|
147
147
|
|
148
148
|
addAssertion 'handle',
|
149
|
-
assert: (@actual, @event)-> actual.data('events')?[event].length
|
149
|
+
assert: (@actual, @event)-> @actual.data('events')?[@event].length
|
150
150
|
assertMessage: 'Expected ${actual} to handle ${event}.'
|
151
151
|
refuteMessage: 'Expected ${actual} not to handle ${event}.'
|
152
152
|
expectation: 'toHandle'
|
153
153
|
|
154
154
|
addAssertion 'handleWith',
|
155
155
|
assert: (@actual, @event, @handler)->
|
156
|
-
stack = actual.data('events')[event]
|
157
|
-
return true for ev in stack when ev.handler is handler
|
156
|
+
stack = @actual.data('events')[@event]
|
157
|
+
return true for ev in stack when ev.handler is @handler
|
158
158
|
false
|
159
159
|
assertMessage: 'Expected ${actual} to handle ${event} with ${handler}.'
|
160
160
|
refuteMessage: 'Expected ${actual} not to handle ${event} with ${handler}.'
|
data/lib/oojs/version.rb
CHANGED
data/oojs.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oojs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Rosenfeld Rosas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oojspec
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fake-ajax-server
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.4.5
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: Object-oriented JavaScript (or CoffeeScript) for Rails
|