carlosbrando / remarkable Goto Github PK
View Code? Open in Web Editor NEWThis project forked from remarkable-rb/remarkable
Simplifying tests!
Home Page: http://www.nomedojogo.com/category/remarkable/
License: MIT License
This project forked from remarkable-rb/remarkable
Simplifying tests!
Home Page: http://www.nomedojogo.com/category/remarkable/
License: MIT License
Here i am facing some dependency issue with rspec version please give us support with latest rspec and launch alpha4 as official release.
Everything is fine, i like this gem too much.
Thanks for making such gem!
Since XHR requests are identified by header, not content type, can’t use describe mime_type to spec them. Adding this option to describe would just set:
request.env[‘HTTP_X_REQUESTED_WITH’] = ‘XMLHttpRequest’
ValidateLengthOfMatcher should pass actual :count option in order to construct valid error message from model. Currently it always set to "12345".
http://github.com/carlosbrando/remarkable/blob/master/remarkable_activerecord/lib/remarkable_activerecord/base.rb#L185
The #context
alias of Spec::Rails::Example::ExampleGroup
is not overridden and therefore points to the original implementation of #describe
.
Like many others I like to use #describe
for the outermost context and #context
for the nested ones.
As a quick fix for that I put the following in my spec_helper.rb: http://pastie.textmate.org/739391
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.
The macro will fail if I don't pass the :message option. I feel passing the :message option should be optional. I don't really care about testing the correct error message.
spec_helper.rb
...
require 'spec/autorun'
require 'spec/rails'
require 'remarkable_rails'
...
results in the following error on ruby 1.9.1
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in load_missing_constant': uninitialized constant Remarkable::ActiveRecord (NameError) from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in
const_missing_with_dependencies'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/remarkable_rails-3.1.10/lib/remarkable_rails/active_orm.rb:17:in <top (required)>' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in
require'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in require' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/remarkable_rails-3.1.10/lib/remarkable_rails.rb:25:in
<top (required)>'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in require' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in
require'
from /Users/user/repos/project.com/spec/spec_helper.rb:7:in <top (required)>' from /Users/user/repos/project.com/spec/models/brand_spec.rb:1:in
require'
from /Users/user/repos/project.com/spec/models/brand_spec.rb:1:in <top (required)>' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:15:in
load'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:15:in block in load_files' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:14:in
each'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/example_group_runner.rb:14:in load_files' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/options.rb:132:in
run_examples'
from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/lib/spec/runner/command_line.rb:9:in run' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/rspec-1.2.9/bin/spec:5:in
The accepts_nested_attributes_for_matcher calls the method +reject_new_nested_attributes_procs+ on an AR class. This method did exist up until rails 2.3.4. In rails 2.3.5 it doesn't exist anymore, therefor specs using this matcher fail.
Running specs on rails 2.3.9.pre warns:
The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead
render_template_matcher.rb line 23:
path_and_file(response.rendered[:partials].keys.first).join(“/_”)
should be:
path_and_file(@response.rendered[:partials].keys.first).join(“/_”)
See the code to understand:
should_have_and_belong_to_many :watches, :class_name => 'List', :conditions => { :pvt => false }
The output:
should have and belong to many watches with class name "List" and with conditions "pvtfalse"
I think this can be:
should have and belong to many watches with class name "List" and with conditions "pvt" equal "false"
This is just a small typo detail, if you can fix it i will appreciate :)
Best regards
Remarkable currently depends upon jnunemaker-validatable 1.8.1 and mongo 0.17.1 and the currently jnunemaker-validatable is at version 1.8.3 and mongo is at 0.19.1 which causes dependency issues with bundler.
my_model_spec.rb:
should_validate_numericality_of :testfield, :less_than => 10.1
my_model.rb
validates_length_of :testfield, :less_than => 10.1
Gives the following error:
'MyModel should ensure numericality of testfield is less than 10.1' FAILED
Expected MyModel to be invalid when testfield is greater than 9.1
The equivalent error happens on :greater_than (but NOT on the _or_equal versions).
(A workaround for floating point numbers ending in .0 is to only specify the integer part on the validator in the model class - in this case no error appears.)
Can it work with AE? AE supports rspec style matchers, would it be possible to use or does Remarkable have very specific RSpec related code that would prevent it from doing so?
I found this morning that when testing for the existence of polymorphic assocations
should_belong_to :commentable, :butter, :polymorphic => true
This test passes with the existence of a commentable association, but ignores the fact that :butter doesn't exist at all. I checked the syntax as I thought perhaps options could only be used with testing single associations like so, but the documentation says otherwise.
should_belong_to :commentable, :polymorphic => true
should_belong_to :butter, :polymorphic => true
Many thanks
RobL
Já existe algum trabalho pra torna o ramarkable compatível com o rspec 2?
Hello carlosbrando,
What you think about use validation_reflection gem to make the ActiveRecord validations?
This will improve speed significantly and add support for more specific options like :if and :unless (currently unsupported). Also the tests will run without querying the database.
Best regards
I believe so far, only validate_is_unique is implemented.
Is there plan to implement the rest of the matchers?
Running under Ruby 1.9.1 throws the exception "uninitialized constant Remarkable::ActiveRecord".
Hello,
I have an older Rails app that has a test dependency on Remarkable Rails 3.1.10. I recently tried to install the gem again and it seems to want to install Rails 3 stuff. According to the RubyGems page (https://rubygems.org/gems/remarkable_rails/versions/3.1.10) I don't see a dependency on Rails 3.
Here is the command that I ran and the output:
gem install remarkable_rails --version 3.1.10
Unable to resolve dependencies: railties requires activesupport (= 3.0.4), actionpack (= 3.0.4), activesupport (= 3.0.4), actionpack (= 3.0.4), activesupport (= 3.0.3), actionpack (= 3.0.3), activesupport (= 3.0.3), actionpack (= 3.0.3), activesupport (= 3.0.2), actionpack (= 3.0.2), activesupport (= 3.0.2), actionpack (= 3.0.2), activesupport (= 3.0.1), actionpack (= 3.0.1), activesupport (= 3.0.1), actionpack (= 3.0.1), activesupport (= 3.0.0), actionpack (= 3.0.0), activesupport (= 3.0.0), actionpack (= 3.0.0)
It used to work fine before Rails 3 came out and at this time we can't upgrade that app to Rails 3.
Is Remarkable Rails version 3.1.10 now dependent on Rails 3 and if not can this be fixed?
Cheers
Hello,
I'm trying to write an Rspec spec of a Rails 3.1.0 model using remarkable remarkable (4.0.0.alpha4), remarkable_activemodel (4.0.0.alpha4) and remarkable_activerecord (4.0.0.alpha4) like this:
class User < ActiveRecord::Base
default_scope :order => "#{table_name}.name ASC"
scope :limited_fields, :select => "#{table_name}.id, #{table_name}.name, #{table_name}.info"
end
Now the spec:
require 'spec_helper'
describe User do
describe "Named Scopes" do
it { should have_default_scope(:order => "#{User.table_name}.name ASC") }
it { should have_scope(:limited_fields).select("#{User.table_name}.id, #{User.table_name}.name, #{User.table_name}.info").order("#{User.table_name}.name ASC") }
end
end
But I got 2 errors.
The first one for the default_scope
:
undefined method `default_scoping' for #<Class:0x007fb5c38bf9b8>
And the second one for the scope
:
Expected :limited_fields when called on User scope to SELECT users.id, users.name, users.info FROM "users" ORDER BY users.name ASC, got SELECT users.id, users.name, users.info FROM "users" ORDER BY users.name ASC
I'm really confused. What did I miss ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.