october 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/Gemfile +35 -0
  2. data/README.md +14 -0
  3. data/Rakefile +38 -0
  4. data/bin/october +8 -0
  5. data/boot.rb +5 -0
  6. data/config/database.yml.example +3 -0
  7. data/config/irc.yml.example +9 -0
  8. data/config/plugins.yml.example +2 -0
  9. data/config/redis.yml.example +7 -0
  10. data/lib/october.rb +16 -0
  11. data/lib/october/base.rb +28 -0
  12. data/lib/october/config.rb +23 -0
  13. data/lib/october/debugger.rb +51 -0
  14. data/lib/october/environment.rb +24 -0
  15. data/lib/october/plugin.rb +26 -0
  16. data/lib/october/plugin/help.rb +20 -0
  17. data/lib/october/plugins.rb +94 -0
  18. data/lib/october/redis.rb +20 -0
  19. data/lib/october/version.rb +3 -0
  20. data/lib/october/watchdog.rb +36 -0
  21. data/october.gemspec +25 -0
  22. data/plugins/.gitkeep +0 -0
  23. data/plugins/autossh.rb +23 -0
  24. data/plugins/fortune.rb +13 -0
  25. data/plugins/help.rb +11 -0
  26. data/plugins/hudson.rb +73 -0
  27. data/plugins/hudson/config.rb +41 -0
  28. data/plugins/hudson/fetcher.rb +40 -0
  29. data/plugins/hudson/reporter.rb +104 -0
  30. data/plugins/hudson/test_run.rb +88 -0
  31. data/plugins/issues.rb +161 -0
  32. data/plugins/joke.rb +32 -0
  33. data/plugins/links.rb +42 -0
  34. data/plugins/links/link.rb +68 -0
  35. data/plugins/service.rb +11 -0
  36. data/plugins/update.rb +79 -0
  37. data/plugins/whisper.rb +70 -0
  38. data/spec/fixtures/hudson/console.log +37 -0
  39. data/spec/helpers/bot_context.rb +5 -0
  40. data/spec/october/environment_spec.rb +28 -0
  41. data/spec/plugins/hudson/reporter_spec.rb +27 -0
  42. data/spec/plugins/hudson/test_run_spec.rb +17 -0
  43. data/spec/plugins/hudson_spec.rb +44 -0
  44. data/spec/plugins/issues_spec.rb +26 -0
  45. data/spec/plugins/links_spec.rb +16 -0
  46. data/spec/plugins/whisper_spec.rb +6 -0
  47. data/spec/spec_helper.rb +13 -0
  48. metadata +185 -0
@@ -0,0 +1,37 @@
1
+ 1) Failure:
2
+ test: Provider #signup_with_plans yields block with buyer and user should set validate_fields for buyer and user. (Logic::SignupTest)
3
+ [test/unit/logic/signup_test.rb:33:in `__bind_1327339644_618417'
4
+ shoulda (2.11.3) lib/shoulda/context.rb:382:in `call'
5
+ shoulda (2.11.3) lib/shoulda/context.rb:382:in `test: Provider #signup_with_plans yields block with buyer and user should set validate_fields for buyer and user. ']:
6
+ <false> is not true.
7
+ [WARN] S3 storage is not enabled.
8
+ L*./test/te
9
+ 61 tests, 175 ass[WARN] S3 storage is not enabled.
10
+ .....
11
+ ........................------......................................................................................................................................
12
+
13
+ (::) failed steps (::)
14
+
15
+ Field 'User extra required' with error not found.
16
+ <false> is not true. (Test::Unit::AssertionFailedError)
17
+ ./features/step_definitions/fields_steps.rb:10
18
+ ./features/step_definitions/fields_steps.rb:9:in `each'
19
+ ./test/unit/bcms/connector_test.rb:10:in `test_should_have_same_account_id_as_page_it_is_connected_to'
20
+ ./features/step_definitions/fields_steps.rb:9:in `/^I should see error in fields:$/'
21
+ /var/lib/jenkins/jobs/michal/workspace/features/signup/fields.feature:47:in `Then I should see error in fields:'
22
+
23
+ Failing Scenarios:
24
+ cucumber /var/lib/jenkins/jobs/michal/workspace/features/signup/fields.feature:25 # Scenario: Required fields on signup
25
+
26
+ 1) Error:
27
+ test: Connector should require account to be set. (ConnectorTest):
28
+ NoMethodError: undefined method `account=' for #<Connector:0x23304350>
29
+ shoulda (2.11.3) lib/shoulda/active_record/matchers/allow_value_matcher.rb:42:in `send'
30
+ shoulda (2.11.3) lib/shoulda/active_record/matchers/allow_value_matcher.rb:42:in `matches?'
31
+ shoulda (2.11.3) lib/shoulda/active_record/matchers/validation_matcher.rb:43:in `disallows_value_of'
32
+ shoulda (2.11.3) lib/shoulda/active_record/matchers/validate_presence_of_matcher.rb:32:in `matches?'
33
+ shoulda (2.11.3) lib/shoulda/assertions.rb:53:in `assert_accepts'
34
+ shoulda (2.11.3) lib/shoulda/context.rb:324:in `__bind_1328529213_791247'
35
+ shoulda (2.11.3) lib/shoulda/context.rb:382:in `call'
36
+ shoulda (2.11.3) lib/shoulda/context.rb:382:in `test: Connector should require account to be set. '
37
+
@@ -0,0 +1,5 @@
1
+ shared_context :bot do
2
+ let(:irc) { Cinch::IRC.new(bot) }
3
+ let(:bot) { October::Base.new }
4
+ before(:each) { bot.stub(:irc) { irc.setup; irc } }
5
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+ require 'october/environment'
3
+
4
+ class TestClass
5
+ extend October::Environment
6
+ end
7
+
8
+ describe TestClass do
9
+ before(:each) { FakeFS.activate! }
10
+ after(:each) { FakeFS.deactivate! }
11
+
12
+ let(:file) { 'irc.yml' }
13
+ let(:config) { Dir.mkdir('config'); File.join('config', file) }
14
+ let(:content) do
15
+ %{test:
16
+ key: val
17
+ }
18
+ end
19
+
20
+ it "should load exising file" do
21
+ File.open(config, 'w') {|f| f << content }
22
+ TestClass.configuration(file, :test).should == {'key' => 'val'}
23
+ end
24
+
25
+ it "should return nil when file does not exist" do
26
+ TestClass.configuration('bogus', :custom).should == nil
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+ require 'hudson/reporter'
3
+
4
+ describe Hudson::Reporter do
5
+
6
+ describe "#report" do
7
+ let(:report) { Hudson::Reporter.new(test).report }
8
+ let(:test) { mock(:test, project: 'name', number: 42, failures: ['first','second']) }
9
+ subject { report }
10
+
11
+ its(:header) { should include 'name/42' }
12
+ its(:length) { should == 2 }
13
+ its(:to_s) { should include report.header, 'first', 'second' }
14
+ end
15
+
16
+ describe "#diff" do
17
+ let(:first) { mock(:first, project: 'first', number: 1, failures: ['first','second']) }
18
+ let(:fifth) { mock(:fifth, project: 'fifth', number: 5, failures: ['second','third']) }
19
+
20
+ let(:diff) { Hudson::Reporter.new([first, fifth]).diff }
21
+ subject { diff }
22
+
23
+ its(:header) { should include "first/1 <=> fifth/5" }
24
+ its(:length) { should == 3 }
25
+ its(:to_s) { should include diff.header, '- first', 'second', '+ third' }
26
+ end
27
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+ require 'hudson/test_run'
3
+
4
+ describe Hudson::TestRun do
5
+ let(:test_run) { Hudson::TestRun.new('name', 42) }
6
+ let(:log) { File.read('spec/fixtures/hudson/console.log') }
7
+
8
+ before(:each) { test_run.stub(:log) { log } }
9
+
10
+ subject { test_run }
11
+
12
+ its(:cucumbers) { should == ['features/signup/fields.feature:25'] }
13
+ its(:test_unit) { should == [
14
+ "test/unit/logic/signup_test.rb -n 'test: Provider #signup_with_plans yields block with buyer and user should set validate_fields for buyer and user. '",
15
+ "(missing file) -n 'test: Connector should require account to be set. '"
16
+ ] }
17
+ end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper'
2
+ require 'hudson'
3
+
4
+ describe Hudson do
5
+ include_context :bot
6
+ let(:plugin) { Hudson.new(bot) }
7
+
8
+ # init plugin
9
+ before(:each) { plugin }
10
+
11
+ describe "#handlers" do
12
+ let(:handlers) { plugin.handlers }
13
+ subject { plugin.handlers }
14
+
15
+ let(:raw) { "PRIVMSG #channel :#{msg}" }
16
+ let(:message) { Cinch::Message.new( raw , bot ) }
17
+
18
+ # FIXME: this is really silly solution
19
+ let(:failures) { handlers.first }
20
+ let(:diff) { handlers.second }
21
+
22
+ describe "valid message" do
23
+ subject { bot.handlers.find(:message, message) }
24
+ let(:msg) { self.class.description }
25
+
26
+ describe "!f job/21 diff another/31" do
27
+ it { should == [diff] }
28
+ end
29
+
30
+ describe "!f my-job" do
31
+ it { should == [failures] }
32
+ end
33
+
34
+ describe "!f job/21" do
35
+ it { should == [failures] }
36
+ end
37
+
38
+ describe "!f my-job-1.9.3" do
39
+ it { should == [failures] }
40
+ end
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+ require 'issues'
3
+
4
+ describe Issues do
5
+ describe 'issue parser' do
6
+ subject { Issues::IssueParser.new text }
7
+
8
+ context 'with all options' do
9
+ let(:text) { "This is issue | and this is body | milestone: ms | assign: person" }
10
+
11
+ its(:assignee) { should == 'person' }
12
+ its(:milestone) { should == 'ms' }
13
+ its(:title) { should == 'This is issue' }
14
+ its(:body) { should == 'and this is body' }
15
+
16
+ its(:to_hash) { should == { title: 'This is issue', assignee: 'person', milestone: 'ms', body: 'and this is body'} }
17
+ end
18
+
19
+ context 'just simple' do
20
+ let(:text) { "title | body" }
21
+
22
+ its(:title) { should == "title" }
23
+ its(:body) { should == "body" }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+ require 'links'
3
+
4
+ describe Links do
5
+ describe "#prefix" do
6
+ subject { Links.prefix }
7
+
8
+ it { should match '!link' }
9
+ it { should match '!links' }
10
+ it { should match '!links ' }
11
+ it { should match '!link ' }
12
+ it { should_not match ' !links' }
13
+ it { should_not match '!posters' }
14
+
15
+ end
16
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+ require 'whisper'
3
+
4
+ describe Whisper do
5
+ # TODO
6
+ end
@@ -0,0 +1,13 @@
1
+ $:.unshift File.expand_path('.') # root
2
+ $:.unshift File.dirname(__FILE__) # spec folder
3
+
4
+ ENV['OCTOBER_ENV'] ||= 'test'
5
+
6
+ require 'boot'
7
+ require 'october'
8
+
9
+ Bundler.require :test, :development
10
+
11
+ Dir['spec/helpers/**/*.rb'].each do |helper|
12
+ require helper
13
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: october
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Michal Cichra
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: i18n
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: cinch
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: fakefs
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ description: IRC Bot
95
+ email:
96
+ - mikz@o2h.cz
97
+ executables:
98
+ - october
99
+ extensions: []
100
+ extra_rdoc_files: []
101
+ files:
102
+ - Gemfile
103
+ - README.md
104
+ - Rakefile
105
+ - bin/october
106
+ - boot.rb
107
+ - config/database.yml.example
108
+ - config/irc.yml.example
109
+ - config/plugins.yml.example
110
+ - config/redis.yml.example
111
+ - lib/october.rb
112
+ - lib/october/base.rb
113
+ - lib/october/config.rb
114
+ - lib/october/debugger.rb
115
+ - lib/october/environment.rb
116
+ - lib/october/plugin.rb
117
+ - lib/october/plugin/help.rb
118
+ - lib/october/plugins.rb
119
+ - lib/october/redis.rb
120
+ - lib/october/version.rb
121
+ - lib/october/watchdog.rb
122
+ - october.gemspec
123
+ - plugins/.gitkeep
124
+ - plugins/autossh.rb
125
+ - plugins/fortune.rb
126
+ - plugins/help.rb
127
+ - plugins/hudson.rb
128
+ - plugins/hudson/config.rb
129
+ - plugins/hudson/fetcher.rb
130
+ - plugins/hudson/reporter.rb
131
+ - plugins/hudson/test_run.rb
132
+ - plugins/issues.rb
133
+ - plugins/joke.rb
134
+ - plugins/links.rb
135
+ - plugins/links/link.rb
136
+ - plugins/service.rb
137
+ - plugins/update.rb
138
+ - plugins/whisper.rb
139
+ - spec/fixtures/hudson/console.log
140
+ - spec/helpers/bot_context.rb
141
+ - spec/october/environment_spec.rb
142
+ - spec/plugins/hudson/reporter_spec.rb
143
+ - spec/plugins/hudson/test_run_spec.rb
144
+ - spec/plugins/hudson_spec.rb
145
+ - spec/plugins/issues_spec.rb
146
+ - spec/plugins/links_spec.rb
147
+ - spec/plugins/whisper_spec.rb
148
+ - spec/spec_helper.rb
149
+ homepage: https://github.com/mikz/october
150
+ licenses: []
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ - plugins
156
+ required_ruby_version: !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ required_rubygems_version: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ! '>='
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ requirements: []
169
+ rubyforge_project:
170
+ rubygems_version: 1.8.24
171
+ signing_key:
172
+ specification_version: 3
173
+ summary: IRC Bot
174
+ test_files:
175
+ - spec/fixtures/hudson/console.log
176
+ - spec/helpers/bot_context.rb
177
+ - spec/october/environment_spec.rb
178
+ - spec/plugins/hudson/reporter_spec.rb
179
+ - spec/plugins/hudson/test_run_spec.rb
180
+ - spec/plugins/hudson_spec.rb
181
+ - spec/plugins/issues_spec.rb
182
+ - spec/plugins/links_spec.rb
183
+ - spec/plugins/whisper_spec.rb
184
+ - spec/spec_helper.rb
185
+ has_rdoc: