minitest-naga 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1b3e4a565baedd3f2f9ee2bfb7859a53a2c88c42
4
+ data.tar.gz: 3a9154301910f14ae88700bcba6980cc38c5a8ca
5
+ SHA512:
6
+ metadata.gz: 1506d4b851601475b496dcdbe65ba6817f7190f94f2d6af2c6e267476c5179afc42626c523fed1f132ed253e2a9d832f310a13576c82edac428f69e935afa721
7
+ data.tar.gz: 6485f9ed4d283b0143e1420e1addb65f1cb6ff81ff179497096cf9c95418b4cdef2ebe03dff302f8fd333e6fcb9c4756fd7840adbcc0990ad5a5965d1319ccb0
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /helpers/
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
5
+ before_install: gem install bundler -v 1.16.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 10-04-2018
10
+ ### Added
11
+ - Added ability to unlock item and other achievements
12
+ - Added an extra city
13
+ - Added restriction so that user can only run a certain amount of times each day
14
+ depending on their level
15
+
16
+ ### Changed
17
+ - Cleaned up the end of the beginning a bit
18
+
19
+ ### Removed
20
+ - Removed starter achievements to only use one
21
+
22
+ ## [0.1.0] - 08-04-2018
23
+ ### Added
24
+ - Added ability to unlock a few starter achievements
25
+
26
+ ### Changed
27
+ - Refined adding item to inventory, either desk, backpack or leave it
28
+
29
+ ## [0.1.0] - 07-04-2018
30
+ ### Added
31
+ - Added ability to check if user has completed the beginning
32
+ - Added ability to explore a location
33
+ - Added ability to collect loot and add to desk or inventory
34
+
35
+ ### Changed
36
+ - Only shows the beginning if they haven't completed it already
37
+
38
+ ## [0.1.0] - 05-04-2018
39
+ ### Added
40
+ - Furthered the beginning
41
+
42
+ ### Changed
43
+ - Refactored the beginning, better use of Highline
44
+ - Changed so separate methods for adding to inventory and to desk
45
+
46
+ ## [0.1.0] - 03-04-2018
47
+ ### Added
48
+ - Added output if user levels up
49
+
50
+ ## [0.1.0] - 20-03-2018
51
+ ### Added
52
+ - Added ability to add starter item to inventory
53
+
54
+ ### Changed
55
+ - Only runs Naga when option is attached
56
+
57
+ ## [0.1.0] - 07-03-2018
58
+ ### Added
59
+ - Added ability to unlock two more achievements
60
+ - Added colorize gem
61
+
62
+ ### Changed
63
+ - Changed output when user has unlocked achievement
64
+ - Refactored Detector and Achievement class
65
+
66
+ ### Removed
67
+ - Removed use of own colorize class
68
+
69
+ ## [0.1.0] - 04-03-2018
70
+ ### Added
71
+ - Added authentication and validates credentials
72
+ - Added ability to unlock first achievement
73
+
74
+ ## [0.1.0] - 26-02-2018
75
+ ### Added
76
+ - Added test connection to localhost server to get achievements
77
+
78
+ ## [0.1.0] - 25-02-2018
79
+ ### Added
80
+ - Added foundations for minitest extension and achievements
81
+
82
+ ## [0.1.0] - 21-02-2018
83
+ ### Added
84
+ - Added bundle gem scaffold
85
+ - Added basic code for game
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at wtwang1@sheffield.ac.uk. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in minitest-naga.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,93 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minitest-naga (0.1.0)
5
+ colorize
6
+ highline
7
+ httparty
8
+ minitest
9
+ thor
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (4.2.10)
15
+ i18n (~> 0.7)
16
+ minitest (~> 5.1)
17
+ thread_safe (~> 0.3, >= 0.3.4)
18
+ tzinfo (~> 1.1)
19
+ aruba (0.14.3)
20
+ childprocess (~> 0.8.0)
21
+ contracts (~> 0.9)
22
+ cucumber (>= 1.3.19)
23
+ ffi (~> 1.9.10)
24
+ rspec-expectations (>= 2.99)
25
+ thor (~> 0.19)
26
+ backports (3.11.1)
27
+ builder (3.2.3)
28
+ childprocess (0.8.0)
29
+ ffi (~> 1.0, >= 1.0.11)
30
+ colorize (0.8.1)
31
+ concurrent-ruby (1.0.5)
32
+ contracts (0.16.0)
33
+ cucumber (3.1.0)
34
+ builder (>= 2.1.2)
35
+ cucumber-core (~> 3.1.0)
36
+ cucumber-expressions (~> 5.0.4)
37
+ cucumber-wire (~> 0.0.1)
38
+ diff-lcs (~> 1.3)
39
+ gherkin (~> 5.0)
40
+ multi_json (>= 1.7.5, < 2.0)
41
+ multi_test (>= 0.1.2)
42
+ cucumber-core (3.1.0)
43
+ backports (>= 3.8.0)
44
+ cucumber-tag_expressions (~> 1.1.0)
45
+ gherkin (>= 5.0.0)
46
+ cucumber-expressions (5.0.13)
47
+ cucumber-tag_expressions (1.1.1)
48
+ cucumber-wire (0.0.1)
49
+ diff-lcs (1.3)
50
+ ffi (1.9.21)
51
+ gherkin (5.0.0)
52
+ highline (1.7.10)
53
+ httparty (0.16.0)
54
+ multi_xml (>= 0.5.2)
55
+ i18n (0.9.5)
56
+ concurrent-ruby (~> 1.0)
57
+ minitest (5.11.3)
58
+ multi_json (1.13.1)
59
+ multi_test (0.1.2)
60
+ multi_xml (0.6.0)
61
+ rake (10.5.0)
62
+ rspec (3.7.0)
63
+ rspec-core (~> 3.7.0)
64
+ rspec-expectations (~> 3.7.0)
65
+ rspec-mocks (~> 3.7.0)
66
+ rspec-core (3.7.1)
67
+ rspec-support (~> 3.7.0)
68
+ rspec-expectations (3.7.0)
69
+ diff-lcs (>= 1.2.0, < 2.0)
70
+ rspec-support (~> 3.7.0)
71
+ rspec-mocks (3.7.0)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.7.0)
74
+ rspec-support (3.7.1)
75
+ thor (0.20.0)
76
+ thread_safe (0.3.6)
77
+ tzinfo (1.2.5)
78
+ thread_safe (~> 0.1)
79
+
80
+ PLATFORMS
81
+ ruby
82
+
83
+ DEPENDENCIES
84
+ activesupport (~> 4.2.0)
85
+ aruba
86
+ bundler (~> 1.16)
87
+ cucumber
88
+ minitest-naga!
89
+ rake (~> 10.0)
90
+ rspec (~> 3.0)
91
+
92
+ BUNDLED WITH
93
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Wen Ting Wang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # Minitest::Naga
2
+
3
+ Welcome! **Minitest::Naga** is a [minitest](https://github.com/seattlerb/minitest "minitest") extension which lets you unlock achievements
4
+ and collect loot when you run your test suite. This is one half of my disseration project which aims to make unit testing a little bit more fun and to help motivate you to do it. The other part which works
5
+ in hand with this Ruby gem is the [Naga web application](https://naga-unit-testing.herokuapp.com/ "Naga's Homepage").
6
+ The web app's main purpose is to manage all the *(hopefully cool)* features of the system as well as the social aspect (e.g. friends and guilds) of Naga.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'minitest-naga'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install minitest-naga
23
+
24
+ ## Usage
25
+
26
+ Firstly, you must [sign up](https://naga-unit-testing.herokuapp.com/users/sign_up "Naga's Sign Up Page") in order to use the gem. So go ahead and do that. I'll wait here...
27
+
28
+ Back? Cool.
29
+
30
+ Given you have this file (adapted from the example provided by minitest's GitHub repo):
31
+ ```ruby
32
+ # a_file_with_lots_of_minitests.rb
33
+ require 'minitest/autorun'
34
+
35
+ class Meme
36
+ def i_can_has_cheezburger?
37
+ "OHAI!"
38
+ end
39
+
40
+ def such_wow
41
+ "such wow"
42
+ end
43
+
44
+ def will_it_blend?
45
+ "YES!"
46
+ end
47
+ end
48
+
49
+ class TestMeme < Minitest::Test
50
+ def setup
51
+ @meme = Meme.new
52
+ end
53
+
54
+ def test_that_kitty_can_eat
55
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
56
+ end
57
+
58
+ def test_that_cate_can_eat
59
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
60
+ end
61
+
62
+ def test_that_doggo_can_eat
63
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
64
+ end
65
+
66
+ def test_that_doge_can_eat
67
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
68
+ end
69
+
70
+ def test_that_it_will_blend
71
+ assert_equal "YES!", @meme.will_it_blend?
72
+ end
73
+
74
+ def test_that_it_will_not_blend
75
+ refute_match /^no/i, @meme.will_it_blend?
76
+ end
77
+
78
+ def test_such_wow
79
+ assert_equal "such wow", @meme.such_wow
80
+ end
81
+
82
+ def test_that_will_be_skipped
83
+ skip "test this later"
84
+ end
85
+ end
86
+ ```
87
+
88
+ To use Naga, just run your test file with the `--naga` flag:
89
+
90
+ $ ruby a_file_with_lots_of_minitests.rb --naga
91
+
92
+ For first timers, you'll be asked to enter your email and password. If you've signed in before, it'll continue to run with that account unless you sign out (see below). Once you've successfully done that, you'll be taken on a weird adventure. So I hope you have fun!
93
+
94
+ If you don't want to use Naga when running your test suite, just omit the flag like so:
95
+
96
+ $ ruby a_file_with_lots_of_minitests.rb
97
+
98
+ ### To Sign Out
99
+
100
+ If you want to sign out, simply run:
101
+
102
+ $ minitest-naga signout
103
+
104
+ ## Development
105
+
106
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
107
+
108
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
109
+
110
+ ## Contributing
111
+
112
+ Bug reports and pull requests are welcome on GitHub at https://github.com/wtwang1/minitest-naga. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
113
+
114
+ ## License
115
+
116
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
117
+
118
+ ## Code of Conduct
119
+
120
+ Everyone interacting in the Minitest::Naga project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/minitest-naga/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "minitest/naga"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/minitest-naga ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'minitest/naga/cli'
3
+
4
+ Minitest::Naga::CLI.start
@@ -0,0 +1,55 @@
1
+ # bundle exec ruby -I lib:test helpers/test_helper.rb
2
+ # bundle exec ruby -I lib:test helpers/test_helper.rb --naga
3
+ require 'minitest/autorun'
4
+
5
+ class Meme
6
+ def i_can_has_cheezburger?
7
+ "OHAI!"
8
+ end
9
+
10
+ def such_wow
11
+ "such wow"
12
+ end
13
+
14
+ def will_it_blend?
15
+ "YES!"
16
+ end
17
+ end
18
+
19
+ class TestMeme < Minitest::Test
20
+ def setup
21
+ @meme = Meme.new
22
+ end
23
+
24
+ def test_that_kitty_can_eat
25
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
26
+ end
27
+
28
+ def test_that_cate_can_eat
29
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
30
+ end
31
+
32
+ def test_that_doggo_can_eat
33
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
34
+ end
35
+
36
+ def test_that_doge_can_eat
37
+ assert_equal "OHAI!", @meme.i_can_has_cheezburger?
38
+ end
39
+
40
+ def test_that_it_will_blend
41
+ assert_equal "YES!", @meme.will_it_blend?
42
+ end
43
+
44
+ def test_that_it_will_not_blend
45
+ refute_match /^no/i, @meme.will_it_blend?
46
+ end
47
+
48
+ def test_such_wow
49
+ assert_equal "such wow", @meme.such_wow
50
+ end
51
+
52
+ def test_that_will_be_skipped
53
+ skip "test this later"
54
+ end
55
+ end