mutant 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ tmp
6
+ .rbx
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --default_path spec
2
+ --color
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use rbx@mutant --create
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
data/lib/mutant.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'mutant/version'
2
+
3
+ module Mutant
4
+ module Runners
5
+ autoload :RSpec, 'mutant/runners/rspec'
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ require 'rspec/core'
2
+
3
+ module Mutant
4
+ module Runners
5
+ module RSpec
6
+ def self.run(args, output)
7
+ raise ::RSpec::Core::Runner.run(args, $stderr, output).inspect
8
+ output.puts 'passed'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ module Mutant
2
+ VERSION = "0.0.1"
3
+ end
data/mutant.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "mutant/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'mutant'
7
+ s.version = Mutant::VERSION
8
+ s.authors = ["Justin Ko"]
9
+ s.email = ["jko170@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Mutation tester}
12
+ s.description = %q{Mutation tester}
13
+
14
+ s.rubyforge_project = "mutant"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- spec/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency 'rake'
22
+ s.add_development_dependency 'rspec', '~> 2.7'
23
+ s.add_development_dependency 'aruba'
24
+ end
@@ -0,0 +1,49 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Mutating booleans' do
4
+ context 'for a singleton method' do
5
+ let(:output) { StringIO.new }
6
+
7
+ context 'that contains `true`' do
8
+ before do
9
+ write_file 'thing.rb', """
10
+ class Thing
11
+ def self.type
12
+ true
13
+ end
14
+ end
15
+ """
16
+ end
17
+
18
+ context 'with an expectation that the return value is true' do
19
+ before do
20
+ write_file 'spec/thing_spec.rb', """
21
+ describe 'Thing.type' do
22
+ specify { Thing.type.should be_true }
23
+ end
24
+ """
25
+ Mutant::Runners::RSpec.run(output)
26
+ end
27
+
28
+ specify 'the mutation passes' do
29
+ output.string.should include('passed')
30
+ end
31
+ end
32
+
33
+ context 'with an expectation that the return value is true or false' do
34
+ before do
35
+ write_file 'spec/thing_spec.rb', """
36
+ describe 'Thing.type' do
37
+ specify { String(Thing.type).should =~ /true|false/ }
38
+ end
39
+ """
40
+ Mutant::Runners::RSpec.run(['--pattern', 'tmp/aruba/*_spec.rb'], output)
41
+ end
42
+
43
+ specify 'the mutation fails', :focus do
44
+ output.string.should include('failed')
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,10 @@
1
+ require 'mutant'
2
+ require 'aruba/api'
3
+
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.filter_run :focus
7
+ config.include Aruba::Api, :example_group => {
8
+ :file_path => /spec\/functional/
9
+ }
10
+ end
metadata ADDED
@@ -0,0 +1,121 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mutant
3
+ version: !ruby/object:Gem::Version
4
+ hash: 856480538658449761
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Justin Ko
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-10-31 00:00:00 -06:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :development
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 2002549777813010636
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ name: rake
33
+ prerelease: false
34
+ requirement: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ type: :development
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ hash: 3833757605560877050
43
+ segments:
44
+ - 2
45
+ - 7
46
+ version: "2.7"
47
+ name: rspec
48
+ prerelease: false
49
+ requirement: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ type: :development
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 2002549777813010636
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ name: aruba
62
+ prerelease: false
63
+ requirement: *id003
64
+ description: Mutation tester
65
+ email:
66
+ - jko170@gmail.com
67
+ executables: []
68
+
69
+ extensions: []
70
+
71
+ extra_rdoc_files: []
72
+
73
+ files:
74
+ - .gitignore
75
+ - .rspec
76
+ - .rvmrc
77
+ - Gemfile
78
+ - Rakefile
79
+ - lib/mutant.rb
80
+ - lib/mutant/runners/rspec.rb
81
+ - lib/mutant/version.rb
82
+ - mutant.gemspec
83
+ - spec/functional/boolean_spec.rb
84
+ - spec/spec_helper.rb
85
+ has_rdoc: true
86
+ homepage: ""
87
+ licenses: []
88
+
89
+ post_install_message:
90
+ rdoc_options: []
91
+
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ hash: 2002549777813010636
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ hash: 2002549777813010636
109
+ segments:
110
+ - 0
111
+ version: "0"
112
+ requirements: []
113
+
114
+ rubyforge_project: mutant
115
+ rubygems_version: 1.5.2
116
+ signing_key:
117
+ specification_version: 3
118
+ summary: Mutation tester
119
+ test_files:
120
+ - spec/functional/boolean_spec.rb
121
+ - spec/spec_helper.rb