Skip to content

Commit

Permalink
bumped version, added gemspec, added rspec environment and first test
Browse files Browse the repository at this point in the history
  • Loading branch information
sroegner committed Apr 21, 2010
1 parent 4655577 commit 3dd8d7a
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.project
.tmp*
.idea
pkg
6 changes: 1 addition & 5 deletions Rakefile
Expand Up @@ -6,14 +6,10 @@ Dir[File.expand_path(File.dirname(__FILE__)) + "/lib/tasks/**/*.rake"].sort.each
RedminePluginSupport::Base.setup do |plugin|
plugin.project_name = 'codebook'
plugin.default_task = [:spec, :features]
# plugin.default_task = [:features]
# plugin.tasks = [:doc, :release, :clean, :test, :db, :spec]
plugin.tasks = [:doc, :release, :clean, :test, :db]
# TODO: gem not getting this automaticly
plugin.tasks = [:doc, :release, :clean, :test, :db, :spec]
plugin.redmine_root = File.expand_path(File.dirname(__FILE__) + '/../../../')
end


begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.0.0
0.3.0
2 changes: 1 addition & 1 deletion init.rb
Expand Up @@ -13,7 +13,7 @@
author 'Steffen Roegner'
author_url 'http://www.sroegner.org'
description 'This is a source code sharing plugin for Redmine'
version '0.2.0'
version '0.3.0'
requires_redmine :version_or_higher => '0.8.1'

settings(:partial => 'preferences/codebook_prefs',
Expand Down
75 changes: 75 additions & 0 deletions redmine_codebook_plugin.gemspec
@@ -0,0 +1,75 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{redmine_codebook_plugin}
s.version = "0.3.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Steffen Roegner"]
s.date = %q{2010-04-21}
s.description = %q{A handy extension to share pieces of code among teams}
s.email = %q{steffen@sroegner.org}
s.extra_rdoc_files = [
"README.md"
]
s.files = [
".gitignore",
"README.md",
"Rakefile",
"VERSION",
"app/controllers/code_documents_controller.rb",
"app/controllers/codebook_controller.rb",
"app/helpers/code_documents_helper.rb",
"app/helpers/codebook_helper.rb",
"app/models/code_area.rb",
"app/models/code_category.rb",
"app/models/code_document.rb",
"app/models/code_language.rb",
"app/views/code_documents/_code_document.html.erb",
"app/views/code_documents/_editor.html.erb",
"app/views/code_documents/edit.html.erb",
"app/views/code_documents/index.html.erb",
"app/views/code_documents/new.html.erb",
"app/views/code_documents/show.html.erb",
"app/views/codebook/_code_area.html.erb",
"app/views/codebook/_code_language.html.erb",
"app/views/codebook/_menu.html.erb",
"app/views/codebook/admin.html.erb",
"app/views/preferences/_codebook_prefs.html.erb",
"assets/stylesheets/codebook.css",
"config/locales/de.yml",
"config/locales/en.yml",
"config/locales/hu.yml",
"config/locales/ja.yml",
"config/routes.rb",
"db/migrate/001_create_code_documents.rb",
"db/migrate/002_create_code_categories.rb",
"features/add_defaults.feature",
"features/support/env.rb",
"init.rb",
"lang/de.yml",
"lang/en.yml",
"lang/hu.yml",
"lang/ja.yml",
"routes.rb"
]
s.homepage = %q{http://github.com/sroegner/codebook}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.6}
s.summary = %q{Share code snippets and gists in redmine}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end

4 changes: 4 additions & 0 deletions spec/controllers/codebook_documents_spec.rb
@@ -0,0 +1,4 @@
require File.dirname(__FILE__) + '/../spec_helper'

puts "put in some controller tests"
# TODO
13 changes: 13 additions & 0 deletions spec/models/codebook_documents_spec.rb
@@ -0,0 +1,13 @@
require File.dirname(__FILE__) + '/../spec_helper'

describe CodeDocument, "the codebook document" do

before(:each) do
@doc = mock_model(CodeDocument, :title => "Example Doc", :id => 10)
end

it "should be happy" do
@doc.should_not be nil
end

end
2 changes: 2 additions & 0 deletions spec/rcov.opts
@@ -0,0 +1,2 @@
--exclude "spec/*,gems/*"
--rails
4 changes: 4 additions & 0 deletions spec/spec.opts
@@ -0,0 +1,4 @@
--colour
--format progress
--loadby mtime
--reverse
48 changes: 48 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,48 @@
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'

# Allows loading of an environment config based on the environment
redmine_root = ENV["REDMINE_ROOT"] || File.dirname(__FILE__) + "/../../../.."
require File.expand_path(redmine_root + "/config/environment")
require 'spec'
require 'spec/rails'
require 'ruby-debug'

# Uncomment the next line to use webrat's matchers
#require 'webrat/integrations/rspec-rails'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}

Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'

# == Fixtures
#
# You can declare fixtures for each example_group like this:
# describe "...." do
# fixtures :table_a, :table_b
#
# Alternatively, if you prefer to declare them only once, you can
# do so right here. Just uncomment the next line and replace the fixture
# names with your fixtures.
#
# config.global_fixtures = :table_a, :table_b
#
# If you declare global fixtures, be aware that they will be declared
# for all of your examples, even those that don't use them.
#
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
#
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
#
# == Mock Framework
config.mock_with :mocha
end

0 comments on commit 3dd8d7a

Please sign in to comment.