jasmine-sinon-rails 1.3.2.1

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.
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ *.rbc
2
+ *.sassc
3
+ .sass-cache
4
+ capybara-*.html
5
+ .rspec
6
+ /.bundle
7
+ /vendor/bundle
8
+ /log/*
9
+ /tmp/*
10
+ /db/*.sqlite3
11
+ /public/system/*
12
+ /coverage/
13
+ /spec/tmp/*
14
+ **.orig
15
+ rerun.txt
16
+ pickle-email-*.html
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
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,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -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,9 @@
1
+ require "jasmine-sinon-rails/version"
2
+
3
+ module Jasmine
4
+ module Sinon
5
+ module Rails
6
+ require 'jasmine-sinon-rails/engine' if defined?(Rails)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Jasmine
2
+ module Sinon
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ # making class enables assets pipeline
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Jasmine
2
+ module Sinon
3
+ module Rails
4
+ VERSION = "1.3.2.1"
5
+ end
6
+ end
7
+ 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: []