Permalink
Browse files

RSpec/Guard infrastructure

  • Loading branch information...
1 parent 94dc9a6 commit 028add1b0d8ee2471860bbb26529879903915b8d @joshuaflanagan committed Nov 11, 2011
Showing with 49 additions and 0 deletions.
  1. +6 −0 Gemfile
  2. +22 −0 Guardfile
  3. +1 −0 lib/stint.rb
  4. +9 −0 lib/stint/project.rb
  5. +8 −0 spec/stint/project_spec.rb
  6. +3 −0 stint.gemspec
View
@@ -2,3 +2,9 @@ source 'http://rubygems.org'
# Specify your gem's dependencies in stint.gemspec
gemspec
+
+group :development do
+ gem 'guard'
+ gem 'guard-rspec'
+ gem 'growl'
+end
View
@@ -0,0 +1,22 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2, :cli => '--color' do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('spec/spec_helper.rb') { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+end
+
View
@@ -1,5 +1,6 @@
require 'stint/version'
require 'stint/github'
+require 'stint/project'
#TODO: get a list of workflow states (from the list of issues)
# get a list of issues in a specific workflow state
# promote an issue into the next higher state (unlabelled, gets 1st state - last state, gets closed)
@@ -0,0 +1,9 @@
+module Stint
+ class Project
+ attr_accessor :repo
+
+ def initialize(repo)
+ @repo = repo
+ end
+ end
+end
@@ -0,0 +1,8 @@
+require 'stint/project'
+
+describe Stint::Project do
+ it "should be associated with a single repository" do
+ project = Stint::Project.new 'githublogin/reponame'
+ project.repo.should == 'githublogin/reponame'
+ end
+end
View
@@ -8,6 +8,9 @@ Gem::Specification.new do |gem|
gem.summary = %q{What are you working on?}
gem.homepage = "https://github.com/joshuaflanagan/stint"
+ gem.add_dependency 'httparty', '~>0.8'
+ gem.add_development_dependency 'rspec', '~>2.0'
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")

0 comments on commit 028add1

Please sign in to comment.