jasmine-sinon-rails 1.3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +16 -0
- data/Gemfile +2 -0
- data/LICENSE +22 -0
- data/README.md +14 -0
- data/Rakefile +2 -0
- data/jasmine-sinon-rails.gemspec +16 -0
- data/lib/jasmine-sinon-rails.rb +9 -0
- data/lib/jasmine-sinon-rails/engine.rb +9 -0
- data/lib/jasmine-sinon-rails/version.rb +7 -0
- data/vendor/assets/javascripts/jasmine-sinon.js +43 -0
- metadata +56 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Mihai Tarnovan
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
jasmine-sinon-rails
|
2
|
+
===================
|
3
|
+
|
4
|
+
jasmine-sinon matchers via Rails 3.1+ asset pipeline
|
5
|
+
|
6
|
+
See https://github.com/froots/jasmine-sinon
|
7
|
+
|
8
|
+
In Gemfile... you know the drill.
|
9
|
+
|
10
|
+
Then put
|
11
|
+
|
12
|
+
#= require jasmine-sinon
|
13
|
+
|
14
|
+
in you spec manifest.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
require File.expand_path('../lib/jasmine-sinon-rails/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Mihai Tarnovan"]
|
6
|
+
gem.email = ["mihai.tarnovan@cubus.ro"]
|
7
|
+
gem.summary = %q{jasmine-sinon.js matchers via Rails 3.1+ asset pipeline}
|
8
|
+
gem.homepage = "https://github.com/mtarnovan/jasmine-sinon-rails"
|
9
|
+
|
10
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
11
|
+
gem.files = `git ls-files`.split("\n")
|
12
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
|
+
gem.name = "jasmine-sinon-rails"
|
14
|
+
gem.require_paths = ["lib"]
|
15
|
+
gem.version = Jasmine::Sinon::Rails::VERSION
|
16
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
(function(global) {
|
2
|
+
|
3
|
+
var spyMatchers = "called calledOnce calledTwice calledThrice calledBefore calledAfter calledOn alwaysCalledOn calledWith alwaysCalledWith calledWithExactly alwaysCalledWithExactly".split(" "),
|
4
|
+
i = spyMatchers.length,
|
5
|
+
spyMatcherHash = {},
|
6
|
+
unusualMatchers = {
|
7
|
+
"returned": "toHaveReturned",
|
8
|
+
"alwaysReturned": "toHaveAlwaysReturned",
|
9
|
+
"threw": "toHaveThrown",
|
10
|
+
"alwaysThrew": "toHaveAlwaysThrown"
|
11
|
+
},
|
12
|
+
|
13
|
+
getMatcherFunction = function(sinonName) {
|
14
|
+
return function() {
|
15
|
+
var sinonProperty = this.actual[sinonName];
|
16
|
+
return (typeof sinonProperty === 'function') ? sinonProperty.apply(this.actual, arguments) : sinonProperty;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
|
20
|
+
while(i--) {
|
21
|
+
var sinonName = spyMatchers[i],
|
22
|
+
matcherName = "toHaveBeen" + sinonName.charAt(0).toUpperCase() + sinonName.slice(1);
|
23
|
+
|
24
|
+
spyMatcherHash[matcherName] = getMatcherFunction(sinonName);
|
25
|
+
};
|
26
|
+
|
27
|
+
for (var j in unusualMatchers) {
|
28
|
+
spyMatcherHash[unusualMatchers[j]] = getMatcherFunction(j);
|
29
|
+
}
|
30
|
+
|
31
|
+
global.sinonJasmine = {
|
32
|
+
getMatchers: function() {
|
33
|
+
return spyMatcherHash;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
})(window);
|
38
|
+
|
39
|
+
beforeEach(function() {
|
40
|
+
|
41
|
+
this.addMatchers(sinonJasmine.getMatchers());
|
42
|
+
|
43
|
+
});
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jasmine-sinon-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.2.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mihai Tarnovan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-01 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description:
|
15
|
+
email:
|
16
|
+
- mihai.tarnovan@cubus.ro
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- Gemfile
|
23
|
+
- LICENSE
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- jasmine-sinon-rails-1.3.2.1.gem
|
27
|
+
- jasmine-sinon-rails.gemspec
|
28
|
+
- lib/jasmine-sinon-rails.rb
|
29
|
+
- lib/jasmine-sinon-rails/engine.rb
|
30
|
+
- lib/jasmine-sinon-rails/version.rb
|
31
|
+
- vendor/assets/javascripts/jasmine-sinon.js
|
32
|
+
homepage: https://github.com/mtarnovan/jasmine-sinon-rails
|
33
|
+
licenses: []
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 1.8.24
|
53
|
+
signing_key:
|
54
|
+
specification_version: 3
|
55
|
+
summary: jasmine-sinon.js matchers via Rails 3.1+ asset pipeline
|
56
|
+
test_files: []
|